Managing brightness on Centos 7

Hey there,
I was having a hard time trying to read on my laptop because of the bright of it, it was low and of course as almost everything on Linux I had to do research to see how to adjust it  which I think it’s the coolest part of using Linux as your personal OS cause you always learn something new.

So, Where to start?
First, check below path:

You will find two folders which are symlinks.  The important thing here are the files inside of them, specially:
brightness: Contains the current bright value.
max_brightness: Contains the maximum possible bright value.
And because I have an intel card then I’ll go into intel_backlight directory and check the files.

Let’s check the values:
As you can see, the current bright I have set up is 300 and the maximum possible value is 976.
So, let’s change the current bright value. You accomplish this by running below command:
echo 350 > /sys/class/backlight/intel_backlight/brightness
Voilà!!! Bright should be increased by now.

You can automate increasing bright with a script. You can call it “”:
brillo=$(cat /sys/class/backlight/intel_backlight/brightness)
echo “Current bright value is:” $brillo
echo “Increasing 50 more”
brillo=expr $brillo + 50
echo “Current bright value is:” $brillo
echo $brillo > /sys/class/backlight/intel_backlight/brightness

For decreasing bright just change the mathematical expression and name this new script something like “”
brillo=$(cat /sys/class/backlight/intel_backlight/brightness)
echo “Current bright value is:” $brillo
echo “Decreasing 50 more”
brillo=expr $brillo - 50        
echo “Current bright value is:” $brillo
echo $brillo > /sys/class/backlight/intel_backlight/brightness

If you want this working for your regular user instead of root, then modify the permissions on file:
Set it up to 646 permissions with “chmod 646 brightness” command (you need to be root to do this). Now not only root will be able to modify bright values but also your personal user.

Finally, in order to run this script from any path, another option is adding them as functions on your .bashrc file located at your home directory. Run “ls -la” in your /home/user directory to see your .bashrc file and edit it with vi.

Voilà!!! It should be working pretty well.

¿Cómo ajustar el brillo de un portatil en linux?

Leave a Reply