Xrandr (Software Level)
Xrandr is a command line app used to manage display output configuration. It can change resolution, orientation, handle multiple displays, and so on. To see your currently used display identifier, run the command below:
You will see some output like this:
510mm x 287mm
The string just before the “connected” part is the identifier for your display (HDMI-A-0 in this case). You can now use the identifier to change the brightness of your display.
To check the current brightness value, use the following command:
To change the brightness, run the following command (replace HDMI-A-0 with your own display identifier):
Note that it doesn’t change hardware level brightness, it is just a software level filter with adjusted gamma values.
Xdotool (Hardware Level)
Xdotool is a command line utility that can be used to run simulated keystrokes and mouse clicks. It is possible to change brightness by simulating keypresses of brightness+ and brightness- buttons on your system.
To install xdotool in Ubuntu, run the following command:
To increase brightness using xdotool, run the following command:
To decrease brightness using xdotool, run the following command:
Since xdotool simulates real hardware keypresses, this is a hardware level change of brightness.
Xgamma (Software Level)
Xgamma, as the name suggests, is a utility to manage gamma values of display. The changes made using xgamma are software level changes, so actual brightness of the monitor is not changed. Xgamma comes pre-installed on most Linux distributions.
To view current gamma values, run the command below (shows RGB values):
To change the gamma value, run a command in the following format:
Xbacklight (Hardware Level)
Xbacklight allows you to configure the backlight intensity of your display. To install it in Ubuntu, run the command below:
Xbacklight may not work on all hardware configurations. To confirm if it works on your system, run the command below:
If you don’t see any output, xbacklight won’t work on your system. To set the backlight brightness, run the command below:
Brightnessctl (Hardware Level)
Brightnessctl allows you to control display backlight and brightness of LED light indicators available on your hardware.
To install brightnessctl on Ubuntu, run the command below:
To list all controllable devices, run the command below:
It may not be easy to correctly identify display identifiers as the names may not be user friendly and you may have to resort to some guesswork to identify the monitor. In the screenshot above, the string for the monitor is “0005:054C:09CC.0005:global”. Once you have identified the correct name, run the command below to change the brightness:
Redshift (Software Level)
Redshift is a command line tool that allows you to manually or automatically set the color temperature and/or brightness of your display.
To install redshift in Ubuntu, run the command below:
To change brightness using redshift, run the command below (0.60 for daytime, 0.70 for night-time, maximum is 1.0, minimum is 0.1):
In addition to brightness controls, redshift also comes with many options to change gamma values as well as color temperature. You can also supply your location to redshift so that display configuration can be changed automatically before and after sunset. Covering other configuration options is out of scope of this article. To see all available options, run one of the commands below:
$ man redshift
Conclusion
These are some of the methods you can use to control brightness or backlight intensity of your display. As stated earlier, some of these methods may not work on your hardware. It is best to try these tools yourself and choose one that works and best suited for your needs.