From 21b20e83b8be60bcd867abe40f00744c72d77aa9 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sun, 22 Aug 2010 22:36:53 +0300 Subject: [PATCH] op_lid: don't save brightness if it's 0 this way op_lid can be called multiple times with same argument. --- testdata/scripts/op_lid.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.39.2