Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a laptop running Xubuntu 12.10 that doesn't save the brightness setting on reboot. There are some explanations on Ask Ubuntu about how to have a specific brightness be set on reboot, but not how to save the brightness from last time. How can this be done?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Create a Bash script to save the brightness:

sudo nano /etc/acpi/save-brightness.sh

It should contain this:

#!/bin/bash
# Saves brightness settings on reboot/shutdown

cat /sys/class/backlight/acpi_video0/brightness > /etc/acpi/brightness

Make it executable:

sudo chmod +x /etc/acpi/save-brightness.sh

Switch to the /etc/rc0.d directory and symlink the script to a link in /etc/rc0.d:

cd /etc/rc0.d
sudo ln -s ../acpi/save-brightness.sh K99-save-brightness

Do this again in the /etc/rc6.d directory (rc0 is for reboots and rc6 is for shutdowns).

Now edit /etc/rc.local to reload the brightness setting on boot.

On a separate line just before the last line that's already there (exit 0), put:

cat /etc/acpi/brightness > /sys/class/backlight/acpi_video0/brightness

Sources:

[1] http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdown

[2] http://askubuntu.com/a/189485/30117

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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