Controlling the brightness of your screen on CentOS via the GUI mode is easy. However, if you are working on a command line system and want to control the brightness of your monitor through the terminal, you need to know some command line tools that are used to control the brightness of your monitor in this situation. After doing some research, I came across a command line tool called “xrandr” that allows you to easily adjust the brightness of your screen. The “xrandr” utility allows you to adjust the size and orientation of the specified screen.
In this article, I will show you how you can adjust the brightness of your screen with the pre-installed xrandr utility on CentOS 8.
To adjust the brightness of your screen, you must follow the steps below:
Step 1: Open the terminal window using shortcut keys Ctrl + Alt + t or you can open it using application launcher search bar as follows:
Step 2: Current state of display system
To check the current state of the display system, screen resolution, and size, you will type the following command on the terminal:
$ xrandr -q
This looks like this in the Terminal:
As you can see in the above-displayed image, the currently connected screen is ‘XWAYLAND0’. The current resolution and screen size are also displayed on the terminal window after executing the above-mentioned command.
Print only the active display name
If you want to view only the currently active display name then you will use “xrandr” with ‘grep’ and the ‘head’ commands as follows:
Step 3: Set screen brightness
You can set the brightness of monitor using the following syntax:
$ xrandr –output [monitor-name] –brightness [brightness-level]
The brightness value limit between 0 to 1 where 0 refers to full black and 1 refers to the brightest value.
For example, we want to set the screen brightness then, you will write a display screen name ‘XWAYLAND0’ and set the value to 0.75. Use the following command to set the brightness of the display screen.
$ xrandr --output XWAYLAND0 --brightness 0.75
In this article you learned how to control the screen brightness with a simple tool xrandr installed on your CentOS 8 system. You can also use brightness control applications on your system to adjust the screen brightness. I hope you will find this article useful in the future.