Why does Ubuntu reset brightness settings at the loading screen?

6,015

Solution 1

With this guide you can save your brightness level on reboot/shutdown and bring it back after system startup. This does not affect system boot up time.


Make a text file in your home directory (or wherever else) to save the brightness level in it. Open up terminal by pressing Ctrl+Alt+T, then enter the following command:

sudo gedit /home/brightness

Save and exit gedit. Just let it be empty. Then type this command in terminal:

sudo gedit /etc/rc0.d/K99FixBrightness

And copy paste the following bash script into it:

#!/bin/bash
brightness=`cat /sys/class/backlight/acpi_video0/brightness`
echo $brightness > /home/brightness
exit 0

Then make it executable by entering: sudo chmod 644 /etc/rc0.d/K99FixBrightness in terminal. Rpeat above steps with rc6.d directory:

sudo gedit /etc/rc6.d/K99FixBrightness

Just so:

#!/bin/bash
brightness=`cat /sys/class/backlight/acpi_video0/brightness`
echo $brightness > /home/brightness
exit 0

Then make it executable by entering: sudo chmod 644 /etc/rc6.d/K99FixBrightness in terminal. Until now we set up the brightness level to be saved in /home/brightness before shutdown and reboot. One step to go! Enter the following command in terminal:

sudo gedit /etc/rc.local

Add this before the last line "exit 0":

brightness=`cat /home/brightness`
echo $brightness > /sys/class/backlight/acpi_video0/brightness

Save and exit gedit. Now with system startup the last brightness level will be loaded!

Done! :)

Solution 2

Have you tried the following?

Open Terminal (Press Ctrl+Alt+T) and type:

sudo gedit /etc/rc.local

Add this before the last line "exit 0":

echo 4 > /sys/class/backlight/acpi_video0/brightness
Share:
6,015

Related videos on Youtube

Clairton Menezes
Author by

Clairton Menezes

Not much to say. Just one more blissfully ignorant random user

Updated on September 18, 2022

Comments

  • Clairton Menezes
    Clairton Menezes over 1 year

    Since I first installed Ubuntu 11.10, I noticed that volume and screen brightness get reset every time Ubuntu starts.

    Why is this so? And what ways are there to keep brightness and volume levels after rebooting?

    I have found some scripts that change the screen-brightness at login. But this is not a good solution since

    • login is slower because it seems to wait until the screen brightness is at the level specified by the script. After entering the password I see the screen brightness go down gradually. Only after this is complete (~1 or 2 seconds) does the background disappear and Unity come up.
    • The screenbrightness is not remembered but instead redefined at login. So it gets remembered for the first part of the boot, then set to MAX and then again re-set to normal value by the script. My boot process is as follows:
      desired brightness: 2 (13,33%) / Max brightness: 15 (100%)
      1. Bios / brightness: OK
      2. GRUB (violet background color, white text) / brightness: OK
      3. Ubuntu loading screen with the dots / brightness: MAX (win7 loads with OK-brightness)
      4. User Login / brightness: MAX
      5. Unity starts / brightness: OK
    • It seems to be more like a temporary patch than a actual solution.

    I'm looking for solutions that set the desired brightness permanently and consistently throughout the whole boot-process

    After updating to 12.04 the behavior is the same.

    I tried

    • setpci -s 02:00.0 F4.B=XX
      The value of F4.B is always '0' regardless of what value I try to set it to (tried 0, ff, f, 5, etc)
    • The solution in this answer does not have any noticeable effect: Desktop doesn't remember brightness settings after a reboot
      The variables at /sys/class/backlight/acpi_video0/ get changed if I use Fn+UP and Fn+DOWN

    Any help is appreciated. Thanks!

    • Admin
      Admin over 10 years
      Did you found the answer to this question. I am getting the same problem please help.
    • Admin
      Admin over 10 years
      @MurtazaMunshi Unfortunately not. I still have the same issue.
    • Admin
      Admin over 10 years
      Damn....Why isn't anyone helping us over here.
  • Clairton Menezes
    Clairton Menezes almost 12 years
    I edited /etc/rc.local but it has no effect ... I did a few reboots to make sure. The value of /sys/class/backlight/acpi_video0/brightness is always 15 after reboot.
  • jasmines
    jasmines almost 12 years
    Have you other folders in /sys/class/backlight/ besides acpi_video0 ? For example, I've got /sys/class/backlight/intel_backlight/brightness too, and I would add also echo 4 > /sys/class/backlight/intel_backlight/brightness to /etc/rc.local
  • Clairton Menezes
    Clairton Menezes almost 12 years
    Thank you for taking the time to look into this! I have just that one acpi_video0 folder nothing else. It has a litlle black arrow, though as if it were a shortcut?
  • jasmines
    jasmines almost 12 years
    Yes, it's a symlink. If you want to know the original folder, just type ls -la /sys/class/backlight/, but this won't help much.