From: vimacs Date: Wed, 17 Feb 2010 12:14:54 +0000 (+0100) Subject: Remember old brightnes, dont use op_bright.sh X-Git-Tag: Release-2010-05/1~114 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59057ad73b927af0c6d816bd33caa13f5eaabff2;p=pandora-libraries.git Remember old brightnes, dont use op_bright.sh modified: testdata/scripts/op_lid.sh --- diff --git a/testdata/scripts/op_lid.sh b/testdata/scripts/op_lid.sh index 1ec445d..88e2087 100755 --- a/testdata/scripts/op_lid.sh +++ b/testdata/scripts/op_lid.sh @@ -3,8 +3,16 @@ #only argument is 0 for open 1 for closed if [ "$1" = "1" ]; then #lid was closed - /usr/pandora/scripts/op_bright.sh 0 + #/usr/pandora/scripts/op_bright.sh 0 + cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness > /tmp/oldbright + echo 0 > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness elif [ "$1" = "0" ]; then # lid was opend - /usr/pandora/scripts/op_bright.sh $(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/max_brightness) + maxbright=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/max_brightness) + oldbright=$(cat /tmp/oldbright) + if [ $oldbright -ge 0 ] && [ $oldbright -le $maxbright ]; then + /usr/pandora/scripts/op_bright.sh $oldbright + else + /usr/pandora/scripts/op_bright.sh $maxbright + fi fi