UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Dimming the display without locking

    Scheduled Pinned Locked Moved Support
    11 Posts 6 Posters 1.5k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • Vehi_MVV Offline
        Vehi_MV @guru
        last edited by

        @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

        N 1 Reply Last reply Reply Quote 0
        • G Offline
          guru
          last edited by guru

          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 170

          When 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 10

          When 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=135

          To be continued ...

          Vehi_MVV 1 Reply Last reply Reply Quote 1
          • Vehi_MVV Offline
            Vehi_MV @guru
            last edited by Vehi_MV

            @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.

            1 Reply Last reply Reply Quote 0
            • G Offline
              guru
              last edited by

              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 5

              While (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...

              1 Reply Last reply Reply Quote 2
              • N Offline
                newguy @Vehi_MV
                last edited by

                @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/brightness

                In 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

                arubislanderA 1 Reply Last reply Reply Quote 0
                • arubislanderA Offline
                  arubislander @newguy
                  last edited by arubislander

                  @newguy Indeed, as you have noticed, the path may differ from device to device, not only between halium devices and mainline devices.

                  πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
                  Happily running Ubuntu Touch
                  Google Pixel 3a (20.04 DEV)
                  JingPad (24.04 preview)
                  Meizu Pro 5 (16.04 DEV)

                  N 1 Reply Last reply Reply Quote 0
                  • N Offline
                    newguy @arubislander
                    last edited by

                    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?

                    AppLeeA 1 Reply Last reply Reply Quote 0
                    • AppLeeA Online
                      AppLee @newguy
                      last edited by

                      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.

                      N 1 Reply Last reply Reply Quote 1
                      • mihaelM Offline
                        mihael
                        last edited by

                        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.
                        1 Reply Last reply Reply Quote 1
                        • N Offline
                          newguy @AppLee
                          last edited by

                          @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.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post