There's already been a topic on this, but I had to modify it some to make it work. Based on sophie5's post at http://ubuntuforums.org/showthread.p...556&p=13217954:
Step 1
Create two scripts in your home directory.
Put the following in ~/brightness-save.sh:
Code:
#!/bin/bash
SAVEFILE="/var/brightness/last_brightness"
mkdir -p $(dirname $SAVEFILE)
cat /sys/class/backlight/acpi_video0/brightness > $SAVEFILE
#echo "Current screen brightness saved as "$(cat $SAVEFILE)"."
exit 0
And put this in ~/brightness-reset.sh:
Code:
#!/bin/bash
DEFAULT_BRIGHTNESS=7
SAVEFILE="/var/brightness/last_brightness"
if [ -f $SAVEFILE ];
then
echo $(cat $SAVEFILE) > /sys/class/backlight/acpi_video0/brightness
#echo "Screen brightness reset to "$(cat $SAVEFILE)"."
else
echo $DEFAULT_BRIGHTNESS > /sys/class/backlight/acpi_video0/brightness
#echo "Screen brightness set to default ("$DEFAULT_BRIGHTNESS")."
fi
exit 0
Step 2
Open a terminal, go to your home directory (cd ~/) and run the following commands, one after another:
Code:
sudo bash
cp ./brightness-reset.sh /etc/init.d
cp ./brightness-save.sh /etc/init.d
chmod +x /etc/init.d/brightness-reset.sh
chmod +x /etc/init.d/brightness-save.sh
ln -s /etc/init.d/brightness-save.sh /etc/rc0.d/S10brightness-save
ln -s /etc/init.d/brightness-save.sh /etc/rc6.d/S10brightness-save
exit
Step 3
Open the file /etc/rc.local as root:
Code:
gksudo gedit /etc/rc.local
If gksudo isn't installed, install it:
Code:
sudo apt-get install gksu
Insert the following code just before line with exit 0. (be sure to save it afterwards)
Code:
etc/init.d/brightness-reset.sh
Step 4
You can delete brightness-save.sh and brightness-reset.sh from your home directory.
Tested and working on my Acer Aspire E11 with 14.04.
Bookmarks