From: Grazvydas Ignotas Date: Sun, 22 Aug 2010 19:36:53 +0000 (+0300) Subject: op_lid: don't save brightness if it's 0 X-Git-Tag: sz_beta3~133^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-libraries.git;a=commitdiff_plain;h=21b20e83b8be60bcd867abe40f00744c72d77aa9 op_lid: don't save brightness if it's 0 this way op_lid can be called multiple times with same argument. --- diff --git a/testdata/scripts/op_lid.sh b/testdata/scripts/op_lid.sh index 67d4ba4..a070d49 100755 --- a/testdata/scripts/op_lid.sh +++ b/testdata/scripts/op_lid.sh @@ -4,8 +4,10 @@ if [ ! -e /tmp/powerstate ]; then #do nothing when in powersave mode if [ "$1" = "1" ]; then #lid was closed - #/usr/pandora/scripts/op_bright.sh 0 - cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness > /tmp/oldbright + brightness=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness) + if [ $brightness -gt 0 ]; then + echo $brightness > /tmp/oldbright + fi echo 0 > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness echo 1 > /sys/devices/platform/omapfb/graphics/fb0/blank elif [ "$1" = "0" ]; then # lid was opend