Linux brightness control

This is more of a note to myself than a blog post, whenever I install some Linux distribution on one of my laptops the first thing to be done is fix brightness controls as it helps to conserve battery life significantly.

The changes required is trivial, start off with figuring out what drivers are in use on your system

ls -ld  /sys/class/backlight/*

should list something like below but not all three, on mine I get intel and acpi

/sys/class/backlight/intel_backlight/

/sys/class/backlight/acpi_video0/

/sys/class/backlight/nvidia_backlight/

So assume you have an intel_backlight entry in the sys filesystem, then try following command to figure out the MAX supported brightness level.

cat /sys/class/backlight/intel_backlight/max_brightness

I get 975, so that would be the maximum possible brightness value your device can produce, if we could set something in between we should be able to control the level of brightness. So try something like this and see if that works, on mine I use “intel_backlight” as I use an intel chipset and run the following command

sudo sh -c “echo 488 > /sys/class/backlight/intel_backlight/brightness”

That sets half the brightness level my laptop supports. so right now you should have an idea about how to control brightness levels using a terminal. So if you bind that command into a key combination and make a shortcut you should be able to set up with any sort of desktop environment you use.

Since you understand the underline brightness control system, here is a better trick which may prevent you from setting up key combinations in your desktop.

I also found that you can let the system know which virtual device to be used for controlling brightness levels. This is done at the boot time, so you need to edit the following file

sudo vim /etc/default/grub

locate GRUB_CMDLINE_LINUX_DEFAULT line and set it to look like the code below

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi_backlight=vendor”

acpi_backlight parameter lets the acpi system know which device to be used for controlling brightness, here vendor refers to intel (in my case).

Hope this helps.

Advertisements

One thought on “Linux brightness control

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