How to save brightness settings?

After I upgraded my notebook to ubuntu 12.04, I found that I can not save my power settings. Every time I set the screen brightness to 70%, it restored to 100% next time. I can't find a save button on the new power setting panel(I am sorry for I can not post a screenshot right now). Can anyone tell me how to save this setting? Thanks.


  1. Check brightness levels by running this command as root:

    cat /sys/class/backlight/acpi_video0/max_brightness 
    

    (my laptop max brightness is 20)

  2. Set you screen brightness to minimum and check current level by evoking next command

    cat /sys/class/backlight/acpi_video0/brightness 
    

    (my laptop min brightness level is 0;)

  3. Edit /etc/rc.local and add before exit 0 the following line:

    echo YOUR_VALUE > /sys/class/backlight/acpi_video0/brightness
    

From now on this brightness level will be set every time you start your computer.


if you just wana change and save the screen brightness only, you can use xbacklight

     sudo apt-get install xbacklight

after installing, type command to set the screen brightness easily

     xbacklight -set `num`

the num is percentage of your screen brightness.

An easier way to set brightness and contrast

     sudo setpci -s `00:02.0` F4.B=`XX` 

to set brightness, 00:02.0 is your VGA device code.XX is hexadecimal form 00 to FF

use lspci command to find out your VGA device code.

     xgamma -gamma `X`

to set contrast,X from 0 to 1