Save Screen Brightness Settings In Ubuntu 14.04

April 18, 2014 — 25 Comments

save ubuntu backlight settings

Laptop users still have the backlight issue in Ubuntu 14.04. Every time Ubuntu boots up you get the maximum level of screen brightness.

Here’s a workaround by adding a startup script which will automatically adjust screen brightness when Ubuntu boots up.

To get started:

Preparation: Open your file browser and navigate to “Computer-> sys -> class -> backlight” directory. You’ll see two or three folders there:

Find Out Actual Backlight Settings Folder

Find Out Actual Backlight Settings Folder

In each folder there’s a file called actual_brightness, you can see its content (brightness value) through the thumbnail icon.
actual-brightness

Remember them and do:

  • Change your screen brightness through Fn + Arrow key.
  • Check out the actual_brightness files in each folder (Re-open each folder to refresh the value).
  • Does the value change?
  • Remember the folder name in which the value of actual_brightness changes.
  • Replace acpi_video0 in below commands with that folder name

1. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the command below will give you the maximum level of your laptop backlight:

cat /sys/class/backlight/acpi_video0/max_brightness

Mine is 9, so I can set backlight level from 0 to 9.

2. Run the command below one by one. You’ll get the super user privilege and open the /etc/rc.local file, a script executed at the end of each multiuser runlevel, with gedit editor.

sudo -i

gedit /etc/rc.local

Add the line below before the last. Change the number 0 to the brightness level you want.

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

save screen brightness ubuntu 14.04

That’s it. Enjoy!

I'm a freelance blogger who started using Ubuntu 5+ years ago and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me on Google Plus or email to ubuntuhandbook1@gmail.com

25 responses to Save Screen Brightness Settings In Ubuntu 14.04

  1. Thank you for this solution! Working perfectly on my laptops.

  2. This is so useful. Each time ,I switch on my laptop ,I manually decrease the brightness. I won’t have to do that aymore. I could now extend this to automate all the tasks that I perform everytime I turn on my laptop. Thanks a lot.

  3. different computers has different settings, on my laptop, it is not
    /sys/class/backlight/acpi_video0/
    so your solution does not apply on all computers

  4. I use the same method explain here to change the defect value of backlight keyboard,
    I fails to configure it to initiate off, but I can it set at minimum. with the following text
    echo 1 > /sys/class/leds/asus::kbd_backlight/brightness
    I hope you explain how to configure this in the future
    Greetings

    hola queria comentar que utilice la misma logica de lo explicado aca para cambiar el valor del brillo del teclado por defecto, con resultados regulares, no inicia apagado, pero inicia al minimo. quizas puedas preparar una entrada con el tema ya que se repite la pregunta en los foros.

  5. It worked perfectly for me. Thanks a lot!

  6. Hi Ji m,

    I read your article concerning “Save Screen Brightness Settings In Ubuntu 14.04″

    I tried your solution but discovered that I didn’t have files or directory under …..
    /sys/class/backlight

    “/acpi_video0/max_brightness” does not exist on my new installation of Ubuntu 14.04.1 on my Sony Vaio VGN-AW11Z laptop.

    Can you advise what I can do to resolve this?

    Thanks in advance, any help would be appreciated.

    Hugh

    • I managed to fix the brightness problem on my Sony Vaio laptop by modifying the directory path from described above.

      cat /sys/class/backlight/acpi_video0/max_brightness # directory “acpi_video0″ doesn’t exist on Sony Vaio laptop so I changed this to….

      cat /sys/class/backlight/nv_backlight/max_brightness # value is 100 for Sony Vaio

      then I tried to edit the brightness file….

      gedit /etc/rc.local # to edit the file

      echo 30 > /sys/class/backlight/nv_backlight/brightness # used 30%

      and it works for my Sony Vaio.

      Thanks for your very good solution

      Hugh

  7. Thank you for proposed solution, but don’t you think that it is rather ridiculous that all this steps are needed to be performed for such a common sense settings, why is it even in the UI then?

  8. before i performed upgrade my ubuntu 14.04 it’s work, but i after upgrade it’s doesn’t work anymore, the first i check value of max_brighness on /sys/class/backlight/acpi_video/max_brighness but there’s no value anymore, even though i change my brighness level on my computer still there’s no value on /sys/class/backlight/acpi_video/max_brighness
    i still remember, i performed upgrade color managed profile on my computer, my computer’s Asus A45VD 4GB RAM, my ubuntu version’s 14.04.1 LTS
    do you know what happening?
    thanks…

  9. In 14.10 I had to use cat /sys/class/backlight/intel_backlight/max_brightness

  10. Thanks for the help! My actual path was “…/intel_backlight/…”.

  11. Thank you so much. Worked liked a charm.

  12. The fastest solution, thanks!

  13. There are no files in the backlight folder.

    When I run “cat /sys/class/backlight/acpi_video0/max_brightness” in the terminal it just comes up with “No such file or directory”

  14. It works like a charm on Asus S301LP ;)

  15. Hello! Thanks for your tip. It works fine with my Toshiba Satellite laptop.
    PS: Where I decrease the brightness of the screen, the value in the “actual_brightness” changes in both folders. I just applied your tip on the /sys/class/backlight/acpi_video0/brightness and it works.

  16. Thank you!

    But for now we have sysvinit script for saving and restoring brightness level between reboots.
    You can install it with the following:
    sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight
    sudo apt-get update
    sudo apt-get install sysvinit-backlight

    (see https://bugs.launchpad.net/bugs/1270579 and http://askubuntu.com/a/227553).

  17. Worked fine on my Asus laptop running 14.04LTS.

    I had values in BOTH folders. acpi_video0 brightness values from 0 to 100 and intel_backlight brightness values to 4882 but I set your startup script to set the level to 82 and on reboot, that’s where the value remianed.

    Thank you!

  18. Hi Ji m,

    I can’t really say that this works on my system. After setting the value like you said, when I reboot, the screen brightness is at its maximum level until I press the brightness_increase key, then the brightness returns to the value set in the script.

    Even when I run the “cat” brightness command, it says the brightness value is what I set, until I tap the increase key then it returns to the value set.

    Any idea?

    Thanks for your help.

    Great work!

  19. First, you have to find where are these files: brightness

    Open a terminal (Control Alt T) and type:

    find /sys -name brightness

    or you can navigate to /sys/class/backlight and see every directory, searching for the brightness file.

    In my system, I had to alter the file /init.d/rc.local adding the line at the bottom:

    echo 350 > full/destination/to/brightness/file

    In my case:

    sergio@acer:/sys$ find /sys -name brightness
    /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness

    (There is also a link to this location in /sys/class/backlight/intel_backlight/brightness)

    Edit the /etc/init.d/rc.local file:

    sudo su
    gedit /etc/init.d/rc.local

    At the bottom, I added this line:

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

    Save and reboot.

    Hope it helps.

  20. echo 7 > /sys/class/backlight/acpi_video0/brightness works fine whit my hp laptop
    Thanx

  21. Awesome work Ji M :-) This worked perfectly on my ASUS laptop! Thanks very much and keep up the good work :-)

  22. thanks a lot , it worked

  23. Thanks a lot. It worked.

Leave a Reply

*

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>