I have found rpgmaker's solution to keeping laptop brightness in Linux Mint. http://askubuntu.com/a/227553
Just to keep it safe, following is a backup of the original article
Original url: http://askubuntu.com/users/116453/rpgmaker
A small script saves last used value of brightness (stored in file BRIGHTNESS_CONTROL) to file (SAVEDFILE) on shutdown and restore it from file on next startup. If there is no such file - script set it do default value (DEFAULT_LEVEL). I placed this file in /etc/init.d/brightness:
#! /bin/sh
### BEGIN INIT INFO
# Provides: brightness
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Save and restore brightness level between restarts.
# Description: This script saves the brightness level between restarts.
# It is called from the boot, halt and reboot scripts.
### END INIT INFO
PATH=/sbin:/bin
SAVEDFILE=/var/lib/brightness-level
DEFAULT_LEVEL=4
BRIGHTNESS_CONTROL=/sys/class/backlight/acpi_video0/brightness
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_status () {
echo -n "Current brightness level is `cat $BRIGHTNESS_CONTROL`"
if [ -f $SAVEDFILE ] ; then
echo ", saved value is `cat $SAVEDFILE`."
return 0
else
echo ", there is no saved value."
return 4
fi
}
case "$1" in
start|"")
[ "$VERBOSE" = no ] || log_action_begin_msg "Initializing brightness level"
# Restore brightness level
if [ ! -f "$SAVEDFILE" ]
then
echo "$DEFAULT_LEVEL" > "$SAVEDFILE"
fi
cat "$SAVEDFILE" > "$BRIGHTNESS_CONTROL"
ES=$?
[ "$VERBOSE" = no ] || log_action_end_msg $ES
;;
stop)
# Save brightness level
[ "$VERBOSE" = no ] || log_action_begin_msg "Saving brightness level"
cat "$BRIGHTNESS_CONTROL" > "$SAVEDFILE"
ES=$?
[ "$VERBOSE" = no ] || log_action_end_msg $ES
;;
status)
do_status
exit 0
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
*)
echo "Usage: brightness start|stop" >&2
exit 3
;;
esac
:
This file is based on /etc/init.d/urandom. You can customize the BRIGHTNESS_CONTROL and DEFAULT_LEVEL for your needs. You can test it from console after running sudo chmod +x /etc/init.d/brightness
- /etc/init.d/brightness status (show current brightness level and saved in file value)
- /etc/init.d/brightness start (set saved level from file)
- /etc/init.d/brightness stop (save current level to file)
For normal operation of the script you need to create symlinks for 0 (shutdown), 6 and S (startup) runlevels.
ln -s /etc/init.d/brightness /etc/rc0.d/S25backlight
ln -s /etc/init.d/brightness /etc/rcS.d/S25backlight
ln -s /etc/init.d/brightness /etc/rc6.d/S25backlight