Adjust brightness in LXDE Linux

This is a little diversion from the usual stats.

I’ve been running LXDE Debian Linux on my small laptop for a while, and I’m really pleased with it. It handles all sorts of stuff and the fact that L stands for Lightweight hardly ever holds me back. But it doesn’t have any screen brightness controls, and it seems lots of people have asked about this on forums. Usually the issue is mixed up with allocating brightness control to a combination of keys, but that’s a bigger problem which depends on exactly the hardware you have. I just fixed it with a simple crude hack, and as it bothers everyone, I thought I’d share it here.

Take a look in your /sys/class/backlight folder. I’ve got a /samsung folder inside that, you might have something different, but whatever you have, look around until you find a file called brightness, and another called max_brightness. Open them in your text editor of choice. In my case max_brightness simply contains the number 8, and brightness 1. To change brightness of the screen, you change the number inside the brightness file. Make a new text file called go-dim, which contains this:

echo 1 > /sys/class/backlight/samsung/brightness

Then, one called go-bright, which contains this:

echo 4 > /sys/class/backlight/samsung/brightness

You don’t have to use 4 as a bright value, you can choose something else (less than or equal to the value inside max_brightness). Then save them somewhere easily accessible like the Desktop, open the terminal and type:

chmod a+x Desktop/go-dim

and

chmod a+x Desktop/go-bright

Now, you can double click those files on your desktop, choose “execute” and they will do their thing for you. Obviously, if you save them somewhere else, you need to type the correct path in the chmod command.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s