Linux: Adjust LCD laptop backlight brightness from command line

I needed to find out how can I change my laptop backlight brighness using just a command line. Solution for that problem was easier than I thought because you can do that just with one line =)

On my laptop which is Dell Latitude D430 brigness file was on /sys/class/backlight/dell_backlight directory but it’s probably almost on the same place /sys/class/backlight/ on every laptop (and linux distribution) which is it possible to change. Before you start to change your laptop display brightness you should find out which is the maximum brigness of your screen which you can see with cat command from the max_brigtness file like this:

cat /sys/class/backlight/dell_backlight/max_brightness

On my laptop max brightness was 7 and surprisingly lowest brightness is 0 so let’s change brightness between 0-7 =)

echo 0 > /sys/class/backlight/dell_backlight/brightness

and when I want full brightness I just write seven to that same file:

echo 7 > /sys/class/backlight/dell_backlight/brightnes

Just be sure that you use > and not >> because >> will just add that number on that file and now we want to remove the old number and add new one there.

So why I needed to do this? I had a script which was checking some things and alert me when something wrong happened so instead of email/sms alerts or audio alerts I just wrote a script which keeps my display as dark as possible and when it needs my attenion it will turn brighness to max and show alerts on display =)

    Leave a Reply

    Your email address will not be published. Required fields are marked *