I’m sure you’ll agree with me when I say adjusting the brightness of our screens can be a real necessity, especially when we’re working late into the night or under different lighting conditions. If you’re using Linux, like me, you may have found that the process isn’t as straightforward as it could be. So, I thought to myself, why not share my own experiences and tricks on how to change the screen brightness in Linux? This guide is packed with easy-to-follow steps and solutions, making it a breeze for anyone to customize their screen brightness for comfort and ease, even if you’re a Linux newbie. Join me as I demystify this process, making your Linux journey that bit smoother.
In this post we will discuss 4 ways to change the brightness on your linux distros like Ubuntu, Arch Linux, Pop OS, Manjaro Linux, Debian etc.,
The first approach is using xrandr
.
xrandr – to change the brightness of output
xrandr
is an official configuration utility to the RandR (Resize and Rotate) X Window System extension. xrandr
is just a simple interface to the RandR extension and has no configuration file. It can be used to set the size, orientation or reflection of the outputs for a screen. For configuring multiple monitors see the Multihead page.
Check if the driver of your graphics card supports it, then you can use xrandr
. To view the current configuration, run the following command-
$ xrandr --current --verbose
To change the configuration of an output i.e., display, then you need the name of the output. You can find the name of the output using the command xrandr --current
, for example LVDS1
is the name of the output.
The brightness can be changed using the following command-
$ xrandr --output <outputname> --brightness 0.75
xrandr is the first approach in case the issue is not at the level of hardware. xrandr
will not change the brightness of the screen at hardware level.
In case xrandr
doesn’t work, we will have to work on the next approach xbacklight
.
Note : xrandr accepts values as decimal values ranging from 0.0 to 1.0
xbacklight – to change the brightness at hardware level
As we discussed above, xbacklight
changes the brightness of the screen at the level of hardware.
To get the current brightness levels, use the following command-
$ xbacklight -get
To set the brightness by percentage, an absolute percentage value, use the following command-
$ xbacklight -set <percentage>
For example,
$ xbacklight -set 80
xbacklight
gives you an option to change the brightness of the screen without even knowing the absolute percentage values. You can change the brightness with relative increment or decrement of value.
To increase the brightness value relatively
$ xbacklight -inc <percentage>
For example,
$ xbacklight -inc 10
To decrease the brightness value relatively
$ xbacklight -dec <percentage>
For example,
$ xbacklight -dec 15
Note : xbacklight accepts values as percentage values ranging from 0 to 100
dbus-send command
If xbacklight
fails and if the keyboard shortcuts are working i.e., if you are able to change the brightness using keyboard shortcuts, then the method using dbus-send
should work.
Command to set brightness percentage
–
dbus-send --session --print-reply --dest="org.gnome.SettingsDaemon" /org/gnome/SettingsDaemon/Power org.gnome.SettingsDaemon.Power.Screen.SetPercentage uint32:`percentage`
For example, to set the brightness to 30%-
dbus-send --session --print-reply --dest="org.gnome.SettingsDaemon" /org/gnome/SettingsDaemon/Power org.gnome.SettingsDaemon.Power.Screen.SetPercentage uint32:30
If it throws an error-
Error org.freedesktop.DBus.Error.UnknownMethod: Method "SetPercentage" with signature "u" on interface "org.gnome.SettingsDaemon.Power.Screen" doesn't exist
Then your operating system is too old. You’ll have to use another tool called xdotool
.
xdotool command – legacy systems
To increase the brightness, run the following command-
xdotool key XF86MonBrightnessUp
To decrease the brightness, run the following command-
xdotool key XF86MonBrightnessDown
As we wrap up, I hope that you now feel more confident and less apprehensive about manipulating the brightness settings on your Linux operating system. Like any journey, navigating through Linux comes with its unique challenges, but with the right guidance, you can turn these stumbling blocks into stepping stones.
In this case, we’ve delved into the process of how to change the brightness of the screen in Linux, exploring various methods and tools to make this task as seamless as possible. Remember, comfort and efficiency are paramount, especially when you’re going to spend hours in front of your computer screen. By mastering these steps, you ensure not only a pleasant but also a healthy computing experience.
Keep experimenting, stay curious, and remember – the power of Linux lies in its flexibility and the freedom it gives its users. So, don’t be afraid to explore and make the system truly your own. Here’s to brighter (or dimmer) days ahead with Linux!