Dimming the display without locking
-
I have configured that my BQ E4.5 locks after 3 minutes of not touching it and some seconds before it dimms. Fine. I would like to have such dimming already after say 15 seconds, but w/o lock. Can this be set somehow from a terminal command? Thanks.
-
@guru
Hi. You can set the brightness of display from terminal.
For example if you want 50% brightness you can use the following command:
echo 50 > /sys/class/leds/lcd-backlights/brightness -
I found a pointer into the right direction in a posting in https://askubuntu.com/questions/628345/how-to-disable-ubuntu-phone-auto-dim-function
One can read and write the value with dconf ... and for 3 minutes (=180 secs) the value gets configured to 170 secs, i.e. 10 secs before locking the screen dims:
$ dconf read /com/ubuntu/touch/system/dim-timeout
uint32 170When I set this to 10 secs, the value is stored, but does not work, i.e. it still uses the old 170 sec value.
$ dconf write /com/ubuntu/touch/system/dim-timeout "@u 10"
$ dconf read /com/ubuntu/touch/system/dim-timeout
uint32 10When one sets a new timeout with the system-settings-app, the value gets again overwritten to, for example, 170 secs. So, it seems that the change with 'dconf...' is not sufficient, but must be noted/stored somehow/somewhere else. A strace of the system-settings-app shows, that the value is written to some file /home/phablet/.config/dconf/user. A modified value survives a reboot (normal, as it stored in that file), but as well does not work after boot.
Here are some more value to read/write/dump:
$ dconf dump /com/ubuntu/touch/system/
[/]
dim-timeout=uint32 170
brightness-needs-hardware-default=false
rotation-lock=true
auto-brightness=true
activity-timeout=uint32 180
brightness=135To be continued ...
-
@guru
So I was playing around with dconf and it looks like the value for "activity-timeout" set with dconf does work.
It allso works after reboot. It is very strange that "dim-timeout" doesnt work.
I allso noticed that when changing "sleep when idle" in battery settings, that "dim-timeout" is always set 10 sec les than "activity-timeout".Edit:
It looks like "dim-timeout" is allways 10 sec less than "activity-timeout" even if you change "activity-timeout" with dconf.
If you for example change "activity-timeout" with dconf to 20 sec the display wil be dimmed after 10 seconds regardless what "dconf dump /com/ubuntu/touch/system/" says. -
The values one sets with dconf can be get or set with gsettings too:
$ dconf write /com/ubuntu/touch/system/activity-timeout "@u 30"
$ dconf write /com/ubuntu/touch/system/dim-timeout "@u 5"$ gsettings list-recursively | egrep 'dim|activity'
com.ubuntu.touch.system activity-timeout uint32 30
com.ubuntu.touch.system dim-timeout uint32 5
org.gnome.settings-daemon.plugins.power idle-dim true
org.gnome.settings-daemon.plugins.power idle-dim true$ gsettings get com.ubuntu.touch.system dim-timeout
uint32 5While (as Vehi_MV says too) the value for acivity-timeout works fine, the used value for dim is always 10 secs before this and not what was set into dim-timeout. This must be a bug in the powerd, perhaps, because the dimming is announced in /var/log/syslog as:
$ sudo grep dim /var/log/syslog
Dec 21 15:49:05 ubuntu-phablet repowerd[917]: DefaultStateMachine: handle_alarm(display_dim)
Dec 21 16:03:22 ubuntu-phablet repowerd[917]: DefaultStateMachine: handle_alarm(display_dim)
Dec 21 16:07:51 ubuntu-phablet repowerd[917]: DefaultStateMachine: handle_alarm(display_dim)and it would be interesting to get to know from where this alarm-clock gets set...
-
@Vehi_MV said in Dimming the display without locking:
@guru
Hi. You can set the brightness of display from terminal.
For example if you want 50% brightness you can use the following command:
echo 50 > /sys/class/leds/lcd-backlights/brightnessIn case anyone else finds this thread, this was very helpful, but the path isn't the same on my system. I'm running 20.04 on the PinePhone and the path for dimming/brightening the screen is:
/sys/devices/platform/backlight/backlight/backlight/brightness
-
@newguy Indeed, as you have noticed, the path may differ from device to device, not only between halium devices and mainline devices.
-
I have a follow-up question.
Using the above path I can change the brightness, but the screen only remains dimmed temporarily (about ten minutes). After that the screen brightens again.
The PinePhone has a brightness range from around 0 to 3000 and the system automatically resets the backlight to 943 after a period.
The "automatically adjust brightness" option is turned off under the battery/power settings.
What service would automatically brighten the screen while the phone is locked and not being used interactively?
-
Hi @newguy
I don't have a clear answer, but maybe a pointer.
The screen is dimmed before turned off after timeout.
I guess when the phone is woke up by pushing the power button the brightness reset to whatever is input in the settings.Or it could have nothing to do with the above given that you don't seem to interact with the phone...
I still would investigate where the system setting for brightness is stored and have a look at the logs.
-
I also experiment with this: https://forums.ubports.com/topic/10672/range-for-manually-adjusting-brightness/6
- so what I noticed on my phone (Oneplus N100) is that it stays on the dimmed brightness until a notification comes (like for an email) - that is why, when I use the dimmed brightness, which is during the whole night - I switch wifi and data off so that it would stay dimmed the whole night - and it does stay indeed.
-
@AppLee It's a good theory. But, as you said, I'm not interacting with the phone. It's locked, sitting on a shelf. No notifications are coming in and the device isn't being touched.
I think there must be a service or background job that is causing the phone to "wake up" or adjust screen settings. Just need to track down what it is.