Screen brightness adjustment is one of the basic tasks on any computer, and often required. However adjusting screen brightness on Linux could be a bit problematic.
Specially on laptops, as there's no dedicated hardware switch directly connected to the display.
Almost on every laptop the brightness up and down keys are combined with another key as a key combination, generally the Fn
key.
On some laptops it just works out of the box by default. But it may require some tweaking to get the screen brightness adjustment working.
Contents
Adjust Linux screen brightness
Here we'll discus about few different method to control brightness the same. Each method usability is depending on the hardware platform you're using like a laptop or desktop.
There's many GUI tool like XFCE Power Manager, to adjust the brightness. But here we'll focus on the command line tools.
1. Enable ACPI backlight keys
If the laptop's default brightness adjustment keys are not working, then add a boot time linux kernel parameter and try again.
- First open up the
/etc/default/grub
file with your favorite text editor as root.sudo nano /etc/default/grub
- Find the line staring with
GRUB_CMDLINE_LINUX_DEFAULT=
, most probably there will be the word quiet also. - Add a few words there,
acpi_backlight=vendor
all inside the double quote. - Save and exit the text editor and then reboot the laptop.
The acpi_backlight
kernel parameter options are not just limited to vendor, and it's guaranteed to work.
You might have to experiment with other options like native
and none
. After rebooting if the brightness adjustment hotkeys are working then you can set a laptop's brightness with the xbacklight command.
If it's not installed, then install it with apt, sudo apt-get install xbacklight
, and then run the command like below.
xbacklight -set 20 # set brightness to 20%
2. Change brightness on Linux through sysfs
If the brightness adjustment key's are not working even after adding the kernel parameters, then you could try to directly manipulate the sysfs interface.
The display backlight related sysfs parameters are under the /sys/class/backlight/
directory. And there might be more than one controller interface.
In my case it's intel_backlight
and acpi_video0
, however it's not possible to change brightness with the second interface, in mu case.
So, first you might want to get an overview, what's actually inside that directories, use the ls command.
ls /sys/class/backlight/intel_backlight/
As you might have guessed, all the options there are quite straight forward to understand.
The value inside the max_brightness file is the maximum brightness you can assign to the display, and it's not possible to change.
The brightness file actually controls the amount of backligh, you can change it like below.
root@host:~# echo 200 > /sys/class/backlight/intel_backlight/brightness
And of course you need root privilege to manipulate that file.
The same thing as also applicable for the acpi_video0
directory, you can adjust linux screen brightness from there, only if it's supported. An example below.
echo '3' > /sys/class/backlight/acpi_video0/brightness # set brightness level 3
3. Using Xrandr command to adjust Linux screen brightness
If it's a desktop or an external monitor is connected to a laptop with a VGA or HDMI cable, then the above method's won't work.
Every external monitor has some kind of remote or dedicated switch to control the brightness, contrast, color saturation etc. etc.
But that might not be enough, to lower the brightness even below the monitor vendor's lowest level, you've to use the xrandr
Linux command line tool.
Few examples in the below list.
- For the internal display of a laptop, which is connected via LVDS, use
xrandr --output LVDS1 --brightness 0.8
- If the monitor is connected to a HDMI port then use
xrandr --output HDMI1 --brightness 0.7
- If the monitor is connected to a VGA port, then
xrandr --output VGA1 --brightness 0.8
- Or if it's a Display Port, use
xrandr --output DP1 --brightness 0.6
Simply you could say the brightness value 0.8 means 80% of the full display brightness, or 0.6 means 60%.
It's basically monitor's gamma adjustment, don't use anything above 1, it will whiten the display.
And it doesn't actually reduce the amount of backlight, more like a transparent black shadow over the display. Still better than nothing, easy on eyes. Read more about the xrandr command here.
Conclusion
It's a short quick tip, hope yo're now a little more familiar with Linux screen brightness adjustment.
If you have any question, suggestion and other methods to suggest, please leave commands below.
Marcos says
Amazing tips. Thank you very much!
shaho says
Thanks for sharing this, It is work for me as well.
Edir says
The grub option worked fine for my Lenovo Legion 5i (Nvidia RTX 2060). Thank You!!!
Sunjoko says
Thanks pal.
It works for me, with a little bit tweaking.
I am using Lenovo Thinkpad T430 and the command I inserted was
xrandr --output LVDS-1 --brightness 0.6
(it accepted LVDS-1, LVDS1 was ignored)
Tomas says
no working for mi on HP 745 G5 , AMD Radeon Vega 6 graphic card, Cpu AMD Ryzen 3 2300u, tried both method
Edward Drake says
xrandr --verbose gave me the output I needed to switch. Built in HP Touchsmart.
xrandr --output LVDS-1 --brightness 0.8
doug morton says
thank you E.D. I have a touchsmart and verbose gave me eDP-1.
I was able to up the brightness to 1.5. Any higher and the screen washed out white. I tried 10 originally and couldn't see anything and had to up arrow and backspace the 10 to set to 1 so I could see again.
simple user says
thanks it's worked !
Amit Ghosh says
Hey thanks for the acpi backlight tip.
I had to add those extra lines on ubuntu 18.04. Brightness control is finally working on my HP laptop.
Arnab Satapathi says
You're most welcome Amit.