From: Grazvydas Ignotas Date: Mon, 6 Aug 2012 21:09:50 +0000 (+0300) Subject: op_power: handle screensaver too X-Git-Tag: sz_152~37 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=c196bff8a1a7e51e13b90d62969bc230abd16345;hp=b61ed9050f151beb6c05a89acb6c3d6244f6e6af;ds=sidebyside op_power: handle screensaver too this used to come through op_lid.sh but that caused problems, as lid can be configured to do things like suspend. --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 9dfdb7c..7ab1bdb 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" DEPENDS = "zenity dbus" RDEPENDS = "zenity dbus" -PR = "r109" +PR = "r110" SRC_URI = " \ file://op_paths.sh \ diff --git a/recipes/pandora-system/pandora-scripts/op_power.sh b/recipes/pandora-system/pandora-scripts/op_power.sh index 0816a3b..85843d8 100644 --- a/recipes/pandora-system/pandora-scripts/op_power.sh +++ b/recipes/pandora-system/pandora-scripts/op_power.sh @@ -103,12 +103,12 @@ lowPowerOn(){ #switch from normal to lowpower mode suspend_net cat /proc/pandora/cpu_mhz_max > /tmp/oldspeed - /usr/pandora/scripts/op_cpuspeed.sh 125 + /usr/pandora/scripts/op_cpuspeed.sh -n 125 } lowPowerOff(){ # switch from lowpower to normal mode oldspeed=$(cat /tmp/oldspeed) - /usr/pandora/scripts/op_cpuspeed.sh $oldspeed + /usr/pandora/scripts/op_cpuspeed.sh -n $oldspeed display_on resume_net @@ -299,7 +299,18 @@ elif [[ "$2" == "lid" ]]; then esac fi fi - fi +elif [[ "$2" == "screensaver" ]]; then + # warning: don't try to interact with X or do real suspend here - + # will cause various deadlocks + unset DISPLAY + + if [[ "$1" == 0 ]]; then # deactivate screensaver + display_on + elif [[ "$1" == 1 ]]; then # activate screensaver + display_off + fi +fi + debug && echo "powerstate=$powerstate" echo "$powerstate" > /tmp/powerstate