2 #actions done when the lid is closed
3 #only argument is 0 for open 1 for closed
5 if [ "$1" = "1" ]; then #lid was closed
6 #/usr/pandora/scripts/op_bright.sh 0
7 cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness > /tmp/oldbright
8 echo 0 > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness
9 elif [ "$1" = "0" ]; then # lid was opend
10 maxbright=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/max_brightness)
11 oldbright=$(cat /tmp/oldbright)
12 if [ $oldbright -ge 3 ] && [ $oldbright -le $maxbright ]; then
13 /usr/pandora/scripts/op_bright.sh $oldbright
15 /usr/pandora/scripts/op_bright.sh $maxbright