Tuesday, 19 April 2016

Set default brightness for your Ubuntu laptop


It is indeed a great hassle when suddenly, in the middle of a working session, you get a notification that your laptop's battery is nearly down. And no matter how many tweaks you may make, unless and until you fix the brightness level properly, power just seems to drain away from your device. In previous versions of Ubuntu such as Karmic Koala, Lucid Lynx etc. you had the option of easily modifying the brightness level, and even on rebooting the system, the brightness level remained the same.

But since the release of Ubuntu 12.04 Precise, a million dollar question has been how to fix this problem os resetting of brightness level upon restart? The answer is very simple, you just need to override the default brightness level, by tweaking a system file. To do this, first run the following command in your terminal:

gksudo gedit /etc/rc.local

This will open the file rc.local in your etc folder which sets the desired brightness. Now, at the end of the file, before 'exit 0', add the following line:


echo X > /sys/class/backlight/intel_backlight/brightness

where X is the value of your desired brightness. Now comes the relatively harder part, estimating the value of X. In my Dell Inspiron laptop, setting X to be 500 simply works. But in some machines, the max brightness may be denoted by 7 and the min value might be 1 and so on. In my opinion, unless you are sure which value to enter, it is a good idea to experiment with different values. But BEWARE, if you enter a very low value for X, the next time you switch on your laptop, the screen will be very dark, so dark that it will be almost impossible for you to see anything before you set the brightness to the correct level using the Brightness and Lock menu from System Settings.

A good idea is to check the current brightness level first by running this command in your terminal:

cat /sys/class/backlight/intel_backlight/brightness

This returns an integer. For example, if it returns 1000, and you wish to make it half, set X=500 in your modifications.

Well, I hope this helps fix your problems, guys. :)

No comments:

Post a Comment