Debian – xbacklight not working

backlightdebiandisplay

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

Best Answer

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>    
    
Related Question