Every time I reboot my machine the brightness goes back to 100% in Gnome. I wish it would keep the last setting. Is there anyway?

link|improve this question

have you tried gnome-session-save? – Hellola Sep 8 '10 at 2:55
Anyone coming here with the same problem, check out @dolhow's answer below. That's the one that works. – Aahan Krish Jan 19 at 4:53
feedback

5 Answers

up vote 6 down vote accepted
+250

This is supposed to be configurable in the energy options, set the brightness to the desired level and it will always be used. If you use a laptop you will also need to configure the level for battery mode as well...

I found that Gnome has some issues about lcd panel brightness, e.g. if I run on battery mode and set the brightness manually to a given level and leave the laptop unattended for 10 seconds it will go back to the preset brightness when I take control back. Same goes when on A/C mode except it takes longer so goes unnoticed more easily. I believe all those settings should be saved somewhere and restored - at least for A/C mode.

EDIT: For gnome3 this does not work (at least for me).

link|improve this answer
I was hoping for something that automatically remembers my changes via keyboard shortcuts, but I guess you are right. – Decio Lira Sep 8 '10 at 17:38
1  
So the answer is...? Changing it in Screen settings doesn't save it for the next session, and there's nothing in Power options. – seanmonstar Nov 10 '11 at 23:09
As far as I remember, the setting is supposed to be restored/saved between sessions. It has been a while since I last toyed with those settings and I don't have access to a machine running the latest Ubuntu at the moment, maybe this is a new bug? – levesque Nov 11 '11 at 15:38
feedback

The file /etc/rc.local should looks like:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo 0 > /sys/class/backlight/acpi_video0/brightness
exit 0

Not like in a first answer.

link|improve this answer
This one works!!! – Aahan Krish Jan 19 at 4:53
In my dell studio 1558 the brightness setting is stored in /sys/class/backlight/intel_backlight/brightness, just change the path if your computer doesn't use the acpi_video0 folder – zurdo Feb 2 at 16:59
feedback

Here is a quick workaround for that :- edit the /etc/rc.local file by typing sudo gedit /etc/rc.local in terminal comment out the exit 0 by adding # in the begining such that it looks like this :-

    #!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

#exit 0

this is necessary otherise it wont work !

after this add the following line in the file

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

such that it looks like this :-

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

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

replace 0 with the required brightness value ( ranges from 0 to 10 )

save the file and exit.

now try testing the setting by typing this command in terminal

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

if the brightness changes to minimum , you have got it right ! reboot to see the changes.

Note :- you may have to replace acpi_video0 with your device code if you have a different one ( its mostly acpi_video0 ). Most of u wont need to do so.

link|improve this answer
This should also work since exit 0 has been commented out. – Aahan Krish Jan 19 at 4:55
1  
But I don't think commenting out exit 0 is the right thing to do. – Aahan Krish Jan 19 at 5:09
feedback

This function, the backlight control, is dependent on your bios and kernel version.

Try these four things.

Kernel (boot) options

When you boot, at the grub screen, hit e to edit. To the kernel line add nomodeset acpi_backlight=vendor Some hardware may work with different options.

Intel - nomodeset acpi_backlight=intel Acer - acpi_backlight=acer_acpi or even acpi_osi=Linux acpi_backlight=legacy.

As you can see, you may need to google search for your settings.

quiet splash nomodeset acpi_backlight=vendor

If that works, edit /etc/default/grub and add those options to the default options.

# command line
sudo -e /etc/default/grub

# graphical
gksu gedit /etc/default/grub

Edit the "GRUB_CMDLINE_LINUX_DEFAULT" line so it looks like this

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset acpi_backlight=vendor"

Save your edit, update grub

sudo update-grub

Command line

If that does not work, you can try to manually set the brightness.

Note: Path may vary with hardware / kernel version, may be /proc/acpi/video0 ..., you may need to browse the /proc/acpi directory to find the brightness setting and adjust the following commands accordingly.

cat /proc/acpi/video/VGA/LCD/brightness

The output of that command varies a bit with hardware, 1 -> 10 , 1 -> 12 , 1 -> 100 ??? Choose a value and set it (choose the value for your hardware).

sudo echo 80 > /proc/acpi/video/VGA/LCD/brightness

If that works, add it to /etc/rc.local

# command line
sudo -e /etc/rc.local

# graphical
gksu gedit /etc/rc.local

Add in your setting above "exit 0"

echo 80 > /proc/acpi/video/VGA/LCD/brightness

xbacklight

You can also try xbacklight

sudo apt-get install xbacklight

You then adjust with the command line

# For 80 % brightness
xbacklight -set 80

Again, add that to /etc/rc.local

# command line
sudo -e /etc/rc.local

# graphical
gksu gedit /etc/rc.local

Add in, above "exit 0"

xbacklight -set 80

setpci

You can try to set your brightness with setpci

The general syntax is

sudo setpci -s <address> f4.B=your_setting

You identify your pci bus address with

sudo lspci | grep VGA

Example

00:02.0 VGA compatible controller: Cirrus Logic GD 5446

setpci -s 00:02.0 F4.B=80

If you get your setting wrong, most likely you will just loose your display, and have to reboot. As this is a hardware setting, you really need to identify your hardware and research the settings first.

Examples

Intel - https://bbs.archlinux.org/viewtopic.php?id=74914

Toshiba - http://www.linlap.com/wiki/toshiba+satellite+t130

Acer extensa - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/518002

Ubuntu man page setpci

link|improve this answer
feedback

Run

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

link|improve this answer
feedback

protected by Community Nov 1 '11 at 19:26

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.