From: vimacs Date: Sat, 26 Dec 2009 21:28:02 +0000 (+0100) Subject: Fixed op_menu if no x is running and added screen poweroff and cpu slowdown to power... X-Git-Tag: Release-2010-05/1~128 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afe1ce98ed16432a541577bda6f16938cc980ff8;p=pandora-libraries.git Fixed op_menu if no x is running and added screen poweroff and cpu slowdown to power button script modified: testdata/scripts/op_menu.sh modified: testdata/scripts/op_power.sh --- diff --git a/testdata/scripts/op_menu.sh b/testdata/scripts/op_menu.sh index b8f957e..2ff040a 100755 --- a/testdata/scripts/op_menu.sh +++ b/testdata/scripts/op_menu.sh @@ -23,7 +23,7 @@ if [ $xpid ]; then fi else echo "no x, killing all pnd aps so x gets restarted" - pndrunning=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p') + pidlist=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p') for PID in $pidlist do kill -9 $PID diff --git a/testdata/scripts/op_power.sh b/testdata/scripts/op_power.sh index a28c9a1..cdbbaf4 100644 --- a/testdata/scripts/op_power.sh +++ b/testdata/scripts/op_power.sh @@ -1,21 +1,23 @@ #!/bin/bash -#actions done when the menu button is pressed +#actions done when the power button is pressed #only argument is the time the button was pressed in seconds if [ "$1" -le "1" ]; then #button was pressed 1 sec or less, resume - pndrunning=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p') + pidlist=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p') for PID in $pidlist do kill -18 $PID #send SIGCONT done - /usr/pandora/scripts/op_cpuspeed 500 + /usr/pandora/scripts/op_cpuspeed.sh 500 + /usr/pandora/scripts/op_bright.sh $(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/max_brightness) elif [ "$1" -le "3" ]; then # button was pressed 1-3sec, "suspend" - pndrunning=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p') + pidlist=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p') for PID in $pidlist do kill -19 $PID #send SIGSTOP done - /usr/pandora/scripts/op_cpuspeed 13 + /usr/pandora/scripts/op_bright.sh 0 + /usr/pandora/scripts/op_cpuspeed.sh 14 elif [ "$1" -ge "3" ]; then #button was pressed 3 sec or longer, shutdown shutdown -h now fi