47

I installed xbacklight, hoping that it would be able to control my brightness. When trying to change brightness, I was told "No outputs have backlight property". After looking around, I found that this has to do with my computer not having a /sys/class/backlight folder. I know that this is the problem but don't know exactly how to fix it.

Not sure if its needed or not but here some system info from inxi:

System:   Kernel: 3.16.0-57-generic x86_64 (64 bit, gcc: 4.8.2) 
          Desktop: LXDE (Openbox 3.5.2) Distro: Ubuntu 14.04 trusty
Machine:  HP EliteBook 8460p
CPU:      Dual core Intel Core i5-2520M CPU
Graphics: Advanced Micro Devices [AMD/ATI] Seymour [Radeon HD 6400M/7400M Series] 

Does this have to do with drivers (perhaps Intel/AMD graphics drivers)?

tshepang
  • 1,967
Carter Roeser
  • 513
  • 2
  • 6
  • 8

7 Answers7

49

Check your /sys/class/backlight folder. If you can see an intel_backlight folder there and still you are getting the above error then creating a /etc/X11/xorg.conf file with the below configuration should work for you. It worked for me.

Section "Device"
    Identifier  "Intel Graphics" 
    Driver      "intel"
    Option      "Backlight"  "intel_backlight"
EndSection

Also, remember to logout and login again for the changes to take effect.

Reference: Backlight - ArchWiki

Kulfy
  • 17,696
vik-y
  • 599
  • 4
  • 4
  • 6
    This answer is the most straightforward for intel_backlight users. – Serge Stroobandt Oct 01 '18 at 20:57
  • 1
    logout and login didn't work for me, i had to reboot – davidchoo12 May 17 '20 at 11:17
  • Had to reboot too. This made xbacklight work but broke my brightness function keys in the process. For some reason xfce needed me to toggle a switch after that change: https://wiki.archlinux.org/index.php/backlight#Backlight_keys_not_working_in_Xfce – gallais Jul 01 '20 at 16:03
  • For some reason, this totally breaks hardware acceleration on a secondary monitor, had to revert – Romuald Brunet Dec 14 '20 at 08:55
  • Shouldn't it be a file in /usr/share/X11/xorg.conf.d on 20.04+? Tried putting it there and SDDM stopped starting :/ – int_ua Jan 03 '22 at 09:06
33

That is completely normal. To find the directory for your backlight settings, do this:

sudo find /sys/ -type f -iname '*brightness*'

The output should give you something like this:

/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness

Now, all you have to do is link it to /sys/class/backlight. To do that:

sudo ln -s /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight  /sys/class/backlight

If you still get the error, then do this:

Create the file xorg.conf:

sudo nano /etc/X11/xorg.conf

And add these lines:

Section "Device"
Identifier  "Card0"
Driver      "intel"
Option      "Backlight"  "NAME OF THE FOLDER"
EndSection

Then, to save the file do: Ctrl + X then Y then Enter.

Also, for the Driver part check for your configuration, i.e., acpi_video0 or intel_backlight.

Raphael
  • 8,035
  • 3
    What if there is already a folder on that path? How do I undo such a replacing ln -s if it breaks brightness (by now it's at least controllable from keyboard)? I've tried creating xorg.conf, added both intel_backlight and the long absolute path to the folder. But it didn't work. So should I:
    1. Try ln -s cuz it's harmless 2. Try some other driver name (btw how do I know it otherwise part of the path?), or 3. Use not the path but the name of the folder (it would be same to Driver field so that's why I'm asking)?
    – mekkanizer Apr 27 '16 at 01:01
  • 16
    In my computer if I open the file /sys/class/backlight/intel_backlight/brightness, I will see an integer value inside it. Just changed the value and saved, my screen immediatelly got the correct brightness. But if I try to use the ln command proposed, I dont have exactly the same folder, and if I try to do this with my intel_backlight folder, I get the error: ln: failed to create symbolic link '/sys/class/backlight/brightness': Operation not permitted – user5193682 Oct 22 '16 at 15:25
  • 1
    @user9589 This sounds like a permission issue. You did execute the ln command as root, didn't you? And I think you were supposed to link the folder, not the brightness file inside that folder. Anyway, the solution didn't work for me, but I already had a /sys/class/backlight folder. – Nobody Nov 06 '16 at 14:08
  • For the xorg.conf, do I write the full path of the folder, or the name "intel_backlight"? – Nolan Akash Feb 18 '17 at 17:58
  • 5
    One reason for "operation not permitted" may be that the file name contains characters that should be escaped. That was the case for me. – Yan King Yin May 06 '17 at 16:03
  • 2
    @YanKingYin How did you do that exactly? – Mephisto Jan 27 '18 at 07:02
  • /sys/class/backlight/intel_backlight the easyer way is just to tell the kernel that it is using the intel-backlight instead of whatever it is expecting – Spark_TheCat Jul 17 '18 at 17:11
  • This did not find my backlight location. This did: ll /sys/class/backlight/ – johny why Sep 06 '18 at 05:04
  • 1
    Is this file also correct, I assume I do not have intel: /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness. I also have a file actual_brightness in acpi_video0, both have a 0 integer as content. – Timo Oct 20 '18 at 06:46
  • Which one is it? There's so many in sys – Philip Rego Feb 12 '20 at 04:56
  • Name of what folder? – lindhe May 20 '20 at 19:53
8

Every step required for xbacklight control

Follow these steps:

  1. $ sudo nano /etc/default/grub and replace the corresponding line with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
  2. $ sudo update-grub
  3. No joking, make sure that the appropriate drivers are actually installed: $ sudo apt install xbacklight xorg xserver-xorg-video-intel
  4. Issuing $ find /sys -type f -name brightness should yield something like /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness
  5. $ cd /sys/class This directory should contain a soft link called brightness to the brightness device discovered in the previous step. Should it be missing, create it: $ sudo ln -s /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness /sys/class/brightness
  6. $ sudo nano /etc/X11/xorg.conf should read:
Section "Device"
    Identifier      "Device0"
    Driver          "intel"
    Option          "Backlight"      "intel_backlight"
EndSection

Section "Monitor" Identifier "Monitor0" EndSection

Section "Screen" Identifier "Screen0" Monitor "Monitor0" Device "Device0" EndSection

  1. The assignment of the physical XF86MonBrightnessDown and XF86MonBrightnessUp keys is explained here for Xubuntu LTS or XFCE users.
  2. Finally, reboot for these changes to take effect.
Serge Stroobandt
  • 5,268
  • 1
  • 48
  • 59
6

I woudn't recommend that way as it starts the old bad maintained Intel driver instead of the modesetting driver.

I created a script instead of using xbacklight:

#!/bin/sh
val=$(cat /sys/class/backlight/intel_backlight/brightness)
if [ "$1" = "+" ] ; then
  val=`expr $val + 5`
else
  val=`expr $val - 5`
fi
echo $val | sudo tee /sys/class/backlight/intel_backlight/brightness

and added tee to sudoers. That works without side effects caused by the Intel driver.

Arno
  • 485
  • does it harm, or have any side effects to run sudo chmod a+rwx /sys/class/backlight/intel_backlight/brightness

    and use your script with 'tee' instead of 'sudo tee'

    – mbkfa93 Sep 19 '20 at 23:32
  • @mbkfa93 how to make this persistent across reboot ? – gruvw Oct 01 '22 at 13:43
  • With some mods, turned out to be my solution in the end. I don't see the need in some specialised HW handling programs if all we need is this nice sysfs interface. My version of the control changes it by logarithmic scale, i.e. multiplying / dividing by a factor (with couple of edge cases) - this is more natural to human's perception of what "equal changes must look like". – Van Jone Feb 01 '24 at 09:09
  • @gruvw: The recipe for persistence is listed on the same acpilight's page from another answer, works for me after changing the permitted group to 'users' (default user group in my system): "" To do so, place a file in /etc/udev/rules.d/90-backlight.rules containing:

    SUBSYSTEM=="backlight", ACTION=="add",
    RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness",
    RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness" ""

    – Van Jone Feb 01 '24 at 09:10
1

If you want to control external monitor, then a way using xbacklight does not work.

You can use xrandr instead of using it.

E.g.:

xrandr --output HDMI1 --brightness 0.5

(You can get monitor name like 'HDMI1' by xrandr --listmonitors.)

ref:archlinux bbs.

  • 1
    Do note this doesn't actually change the brightness of your monitor's backlight. As per xrandrs man page: "Multiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight." – Alex Oct 25 '22 at 19:41
0

I am an Arch Linux user and I encoutered same problem. I can't link driver to /sys/class/backlight because /sys/class/backlight existed as a directory and I can't replace it.

After some research I found Yuri D'Elia / acpilight · GitLab. I installed acpilight with pacman and problem solved.

Now I can change brightness of screen with xbacklight +5.

Kulfy
  • 17,696
Mesut Tasci
  • 101
  • 1
0

For me, modifying the kernel parameter acpi_backlight to native worked:

cat /boot/loader/entries/arch.conf
  • options root=UUID=... acpi_backlight=vendor rw
  • options root=UUID=... acpi_backlight=native rw

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Apr 28 '23 at 10:52