6

I have my ASUS X556U with DualBoot between W10 and Debian Jessie, but I need to regulate the brightness.

I've been serching in Google and I found xbacklight, but I have a problem while executing it:

barreeeiroo@Debian-Diego ~> xbacklight -dec 10
No outputs have backlight property
barreeeiroo@Debian-Diego ~> 

Then I search in Google more info about the problem, and I found this post, but it causes another problem:

barreeeiroo@Debian-Diego ~> 
sudo ln -s /sys/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/rtsx_usb_sdmmc.4/leds/mmc0::/brightness  /sys/class/backlight
[sudo] password for barreeeiroo: 
ln: failed to create symbolic link ‘/sys/class/backlight/brightness’: Operation not permitted
barreeeiroo@Debian-Diego ~> 

I've adapted the route to my computer

Then I tried to use chmod and chown, but is the same problem.


So, my questions are:

  1. Is possible to fix that error?
  2. Is there any other method to manage brightness in Debian?

Thanks

Diego Barreiro
  • 161
  • 1
  • 1
  • 3

4 Answers4

14

Arch Linux has the following to say about xbacklight:

Brightness can be set using the xorg-xbacklight package.

Note: xbacklight only works with intel. Radeon does not support the RandR backlight property. xbacklight currently does not work with the modesetting driver.

To set brightness to 50% of maximum:

$ xbacklight -set 50

Increments can be used instead of absolute values, for example to increase or decrease brightness by 10%:

$ xbacklight -inc 10
$ xbacklight -dec 10

If you get the "No outputs have backlight property" error, it is because xrandr/xbacklight does not choose the right directory in /sys/class/backlight. You can specify the directory by setting the Backlight option of the device section in xorg.conf. For instance, if the name of the directory is intel_backlight, the device section can be configured as follows:

/etc/X11/xorg.conf
-------------------
Section "Device"
    Identifier  "Card0"
    Driver      "intel"
    Option      "Backlight"  "intel_backlight"
EndSection

The following worked for me on Debian Stretch LXDE.

  1. Checked the backlight directory: ls /sys/class/backlight. I happen to have intel_backlight.

  2. To get the Identifier, I ran xrandr --verbose. Mine happened to be 0x72.

  3. Checking /etc/X11/, I found no xorg.conf, so I made my own and entered the information I had found:

    Section "Device"
        Identifier  "0x72"
        Driver      "intel"
        Option      "Backlight"  "intel_backlight"
    EndSection
    
  4. I then rebooted. It worked from there.

  5. Since LXDE runs openbox, I edited ~/.config/openbox/lxde-rc.xml and inserted the following keybindings:

    <!-- Increase backlight 10% -->
    <keybind key="XF86MonBrightnessUp">
      <action name="Execute">
        <command>xbacklight -inc 10</command>
      </action>
    </keybind>
    
    <!-- Decrease backlight 10% -->
    <keybind key="XF86MonBrightnessDown">
      <action name="Execute">
        <command>xbacklight -dec 10</command>
      </action>
    </keybind>    
    
Lorem Ipsum
  • 430
  • 4
  • 11
6

Just managed to control my screen brightness in Debian with xrandr.

xrandr --output [your display] --brightness 0.8

You can find your display name by typing xrandr - you'll see it as something like "[your display] connected primary 1920x1080..."

Next up... key bindings!

  • 6
    According to `man xrandr`: *“--brightness brightness […] However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.”* – Denilson Sá Maia Jun 26 '18 at 14:47
  • This seems to change the color temperature too, or maybe it's cause I have Gnome Night Light on. – wjandrea May 05 '19 at 05:29
  • this answer is incorrect, because this does *not* change the backlight, only the software brightness, which is something else – xdavidliu Dec 13 '19 at 03:34
  • I've been looking for a solution to this literally for years, this finally worked – snaut Feb 25 '23 at 22:39
5

There is a direct xbacklight replacement that is compatible with non-Intel drivers: acpilight. Arch Linux already has it packaged, on Debian you will need to install it manually:

git clone https://gitlab.com/wavexx/acpilight
cd acpilight
sudo make install

acpilight replaces the xbacklight command, supporting most of its syntax and adding a few extra features like keyboard backlight control on compatible hardware. The brightness is set via sysfs rather than xrandr extensions, so it's wise to check if /sys/class/backlight/ is populated before trying to use it.

Dmitry Grigoryev
  • 7,123
  • 2
  • 23
  • 62
0

One potential cause of error may also be the modesetting display driver. xbacklight does currently not work with modesetting.

Another option: Using brightnessctl, which uses udev and systemd to take care of the whole permission stuff.

On Ubuntu 18.04, the udev rule wasn't installed properly, so I had to get it manually:

cd /etc/udev/rules.d
wget https://raw.githubusercontent.com/Hummer12007/brightnessctl/master/90-brightnessctl.rules

and then add myself to the necessary groups:

usermod -a -G video input <user>

After rebooting, I could use brightnessctl s 10%+ and created a keybinding for that in i3.

iFreilicht
  • 898
  • 10
  • 14