Ubuntu 11.10 doesn't save my brightness settings between sessions. Everytime I boot up, the brightness is always at zero, and I always have to set it back to my preferred setting (at maximum). How can I ensure that my brightness preference will persist after reboot?
In the file
/etc/rc.local add before line
echo 5 > /sys/class/backlight/acpi_video0/brightness
Where 5 is the brightness level from 0 to 10
Basically you need to run
echo X > /sys/class/backlight/acpi_videoY/brightness
during the boot process after the graphics drivers have loaded with appropriate
Y. The other answers and comments explain how to find
/etc/rc.local suggestion works, the most consistent way of doing this, in my opinion is the following:
Create a file, say
/etc/init (avoid collisions with existing filenames in that directory) as root with the following contents:
description "Sets brightness after graphics device is loaded" start on graphics-device-added task exec echo X > /sys/class/backlight/acpi_videoY/brightness
This way, the behaviour of the system will the same as systems without this particular quirk (of brightness being 0 at startup). In the
/etc/rc.local method, there is usually a small period when the brightness remains 0.
Also, this should remove the necessity (in some systems) of having to
sleep 2 before
echo... - not checked though. (See http://xchamitha.blogspot.co.uk/2013/07/set-screen-brightness-when-booting.html or http://ubuntuforums.org/archive/index.php/t-2061712.html for example)
You should probably check first:
ls /sys/class/backlight/ | grep 'acpi_video'
So you will get list of all possible displays and then you can experiment to find which is the display you want to modify. On one laptop, the screen was called "acpi_video0". Replace "acpi_video1" below with the actual screen name of your screen. On systems using the initsystem (e.g. 11.10) I must put
echo 5 > /sys/class/backlight/acpi_video1/brightness
/etc/rc.local file, whereas on systems using the newer upstart mechanism (e.g. 13.04) I must put this into
start on runlevel  stop on runlevel  script echo 5 > /sys/class/backlight/acpi_video1/brightness end script post-stop script end script
protected by Community♦ May 4 '12 at 15:36
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?