Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

  1. #1
    Join Date
    Oct 2016
    Location
    USA
    Posts
    92

    Default How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Good day, folks.
    I recently purchased a new laptop from Tuxedo Computers of Germany, and all in all it is quite lovely.
    I do have a question regarding backlight management, though. When in the GNOME desktop, there is a slider applet in the top bar that lets me adjust the brightness of the computer.
    I am curious how GNOME accomplishes this without root privileges on a system with 8th gen Intel laptop processor and graphics. I want to do this myself in my i3wm configuration.
    I have tried xbacklight, but it tells me that no displays have the backlight property. Currently I edit as super user the file "/sys/class/backlight/intel_backlight/brightness" and insert the appropriate value between 1 and ~3400.
    If it is not feasible to adjust the backlight the way GNOME does it, I could really use any way to adjust it that does not require root permissions.
    Thank you all so much!

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,269
    Blog Entries
    1

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Just a guess here, but probably using xrandr....
    Code:
    xrandr --verbose |egrep -i "brightness|gamma"
    Try setting (eg HDMI-1) with something like
    Code:
    xrandr --output HDMI-1 --brightness 0.7
    openSUSE Leap 15.0; KDE Plasma 5

  3. #3
    Join Date
    Oct 2016
    Location
    USA
    Posts
    92

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Yeah, I've used the brightness setting in Xrandr, and it works, but it does not affect the backlight, so it saves no battery.

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,269
    Blog Entries
    1

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Quote Originally Posted by Amlypygid View Post
    Yeah, I've used the brightness setting in Xrandr, and it works, but it does not affect the backlight, so it saves no battery.
    Sorry, I'm not a Gnome user and didn't realise that Gnome was adjusting backlight levels.

    What (if anything) does the following report?
    Code:
    ls /sys/class/backlight
    openSUSE Leap 15.0; KDE Plasma 5

  5. #5
    Join Date
    Oct 2016
    Location
    USA
    Posts
    92

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Right. That directory contains only the intel_backlight directory, which in turn contains

    Code:
    wilsontux@linux-idrr:~> ls -o /sys/class/backlight/intel_backlight/
    total 0
    -r--r--r-- 1 root 4096 Jul 18 18:53 actual_brightness
    -rw-r--r-- 1 root 4096 Jul 18 18:53 bl_power
    -rw-r--r-- 1 root 4096 Jul 18 18:53 brightness
    lrwxrwxrwx 1 root    0 Jul 18 18:53 device -> ../../card0-eDP-1
    -r--r--r-- 1 root 4096 Jul 18 18:53 max_brightness
    drwxr-xr-x 2 root    0 Jul 18 18:53 power
    lrwxrwxrwx 1 root    0 Jul 18 18:53 subsystem -> ../../../../../../../class/backlight
    -r--r--r-- 1 root 4096 Jul 18 18:53 type
    -rw-r--r-- 1 root 4096 Jul 18 18:53 uevent
    I change my backlight by
    Code:
    sudo vim /sys/class/backlight/intel_backlight/brightness

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,269
    Blog Entries
    1

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Perhaps Gnome is using a D-Bus method....
    https://wiki.archlinux.org/index.php...Bus_with_Gnome
    Maybe the backlight can be adjusted in a similar fashion.
    openSUSE Leap 15.0; KDE Plasma 5

  7. #7
    Join Date
    Oct 2016
    Location
    USA
    Posts
    92

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Okay, I gave that a try. The result in i3 is:
    Code:
    wilsontux@linux-idrr:~> gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown
    Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SettingsDaemon.Power was not provided by any .service files
    I'll be right back with the results while GNOME is running.

  8. #8
    Join Date
    Oct 2016
    Location
    USA
    Posts
    92

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Works fine in GNOME.

  9. #9
    Join Date
    Oct 2016
    Location
    USA
    Posts
    92

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    Now looking into other methods suggested on the Arch Wiki.

  10. #10
    Join Date
    Oct 2016
    Location
    USA
    Posts
    92

    Default Re: How does GNOME Handle backlight, and how can I do it from CLI without root privileges?

    I got the package "illum" from the hardware experimental repository. Installed it, used systemctl to start illum.service, and now my backlight keys do exactly as intended. Thanks for linking me to that arch page!

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •