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?
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