Change brightness of Ubuntu 13.04

Recently I’ve become aware that I don’t usually document my problems or solutions, which usually means I end up searching Google time after time in a desperate attempt to find the same blog or forum post which helped me the last time round. So from now on I’ll start posting the problems and solutions to my own blog, which I imagine will be substantially easier to find!

On this weeks agenda, changing the brightness level on my laptop which is using Ubuntu. Unfortunately the keyboard shortcuts to change brightness level don’t work and the many different programs I’ve tried to use have also failed me, so having found an answer which solved my problem I wrote a script to make it considerably easier to manage.

How to do it

1. To figure out what the maximum brightness setting you can use is:

cat /sys/class/backlight/intel_backlight/max_brightness

* Change intel_backlight as appropriate

2. To see what your current brightness setting is use the following command:
cat /sys/class/backlight/intel_backlight/brightness

3. Now you know what your current brightness setting is, and what the upper limit is, chose a suitable brightness setting and change your brightness using the following command:

echo xxx | sudo tee /sys/class/backlight/intel_backlight/brightness

* Change xxx to the appropriate number and intel_backlight as nescessary.

The Script

I write everything in Perl now and this is no expression; either copy and paste the code below into your text editor and save it or download it further below.

#!/usr/bin/perl

use strict;
use warnings;

my $input = $ARGV[0];

`echo $input | sudo tee /sys/class/backlight/intel_backlight/brightness`

Irrespective of whether or not you copy/paste from above or download the copy below; you’ll need to make sure to change ‘intel_backlight’ as nescessary.

Download Backlight here!

Leave a Reply

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