I'm was the same problem, but I would like to have automatically saving and restoring the brightness. Reading this thread I'm found a solution:
1. To avoid sleeping I'm use a udev rule:
Code:
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/etc/udev/brightness.sh restore"
2. To save a brightness state, I'm have a rc.local_shutdown with these lines:
Code:
if [ -x /etc/udev/brightness.sh ] ; then
/etc/udev/brightness.sh store
fi
3. Here is a script that makes all the work:
Code:
#!/bin/sh
restore() {
if [ -f /etc/brightness ]; then
echo -n "Restoring previous brightness value... "
cat /etc/brightness > /sys/class/backlight/intel_backlight/brightness && echo "Done."
fi
}
store() {
echo -n "Saving current brightness value to /etc/brightness... "
cat /sys/class/backlight/intel_backlight/brightness > /etc/brightness && echo "Done."
}
case $1 in
store) store;;
restore) restore;;
*) echo "Usage: $0 store | restore"
esac