Wow, thank you @direc85!
But from my side, the full instruction I think should be:
Open text editor with
devel-su nano /usr/bin/X10IIIFixBrightness.sh
And in it paste:
#!/bin/bash
dbus-monitor --system sender=com.nokia.mce,interface=com.nokia.mce.signal,member=display_status_ind |
while read -r line; do
if [[ "$line" == *"\"on\""* ]]
then echo 1 > /sys/devices/dsi_panel_driver/hbm_mode ; sleep 0.1 ; echo 0 > /sys/devices/dsi_panel_driver/hbm_mode;
fi
done
Then make the script executable using:
devel-su chmod +x /usr/bin/X10IIIFixBrightness.sh
Then create a systemd service to start it at boot.
devel-su nano /usr/lib/systemd/system/FixBrightness.service
And paste there:
[Unit]
Description=Brightness fixer for Xperia 10III
Documentation=https://forum.sailfishos.org/t/11659/
After=ofono.service lipstick.service mce.service dbus.service
Wants=mce.service
AssertPathExists=/sys/devices/dsi_panel_driver/hbm_mode
[Service]
ExecStart=/usr/bin/X10IIIFixBrightness.sh
Restart=always
RestartSec=15s
[Install]
WantedBy=graphical.target
Then do sudo systemctl start FixBrightness.service
to test it, and sudo systemctl enable FixBrightness.service
to start it at boot.
To test if it works, reduce the screen brightness to minimum, turn the screen off and then back on. Without the script the colors were washed out, but with it you would see the old colors for a fraction of a second, and then immediately the colors should get better, if you got lucky with your display model.
Hope this helped!