How to change screen brightness in Ubuntu using command terminal

Do you want to control or reduce the brightness of the Ubuntu 18.04/19.04/20.04 or in earlier versions of this Linux distro including Linux Mint using Command terminal? Then here is the way…

Recently, I installed Ubuntu 20.04 Focal Fossa on my desktop but the immediate problem I faced after the installation was, no dedicated option to reduce the screen brightness which was literally hurting my eyes. Indeed, we can install different third-party software to control the brightness of the Ubuntu, however, if you mainly work with the command line and don’t want to add some extra program then inbuilt command terminal is enough.

We can use the Xrandar utility of the Ubuntu to adjust the screen brightness in just a few commands as per the requirement.

Control Ubuntu Screen brightness with Terminal


For this tutorial, we have used the Ubuntu 20.04 LTS where we had run the following given commands to use the Xrandr for adjusting the computer monitor’s brightness level.

Open command terminal

Simply, open the command terminal from Ubuntu’s Activities or use the shortcut keys for it: CTRL+ALT+T.

Update System

To make sure everything is up to date run the system update command:

sudo apt update

Use xrandr to see the Monitor’s name 

To know the monitor hardware name you are using to work with the Ubuntu system, we will use the Xrandr tool. It is a  configuration utility to the RandR (Resize and Rotate) X Window System extension. We can use this tool to control the brightness of the screen along with size, orientation or reflection of the outputs. We don’t need to install this on our system, by default it is available on Ubuntu 20.04, 19.04 or 18.04…

Here is the command to fetch the name of the attached display to our Ubuntu system.

xrandr | grep " connected" | cut -f1 -d " "
Use xrandr to see the Monitor’s name 
xrandr command to see connected the Monitor’s name

 

Adjust Ubuntu Linux brightness level using xrandr

No, let’s see the final command to increase or decrease the brightness of Ubuntu’s connected monitor. Below is the command format we are going to use in which replace the display name with the name of the monitor you are using, found using the above command. Whereas the level of illumination will be replaced by the number or amount of brightness you want on your Ubuntu screen.

xrandr --output [display-name] --brightness [level of illumination]

The level of illumination number format will be between  0.5 to 1, higher the number the brighter the display will be, thus to reduce the brightness use the lower number for example 0.5.

In our case, the name of the display was VGA-1 and the amount of brightness we want is 0.5, thus the above command will be like this:

xrandr --output VGA-1 --brightness 0.5

You can use your display name in the above command.

Adjust Ubuntu Linux brightness level using xrandr
command to change the brightness level in Ubuntu Linux

So, this was the simple command to increase or decrease the Linux system brightness. Just try it to adjust display light as per your surrounding conditions.

 

4 thoughts on “How to change screen brightness in Ubuntu using command terminal”

  1. Its looks like it change the Gamma value of display a dont change the brightness and the power consume of display.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.