From c196bff8a1a7e51e13b90d62969bc230abd16345 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Tue, 7 Aug 2012 00:09:50 +0300 Subject: [PATCH] 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. --- recipes/pandora-system/pandora-scripts.bb | 2 +- .../pandora-system/pandora-scripts/op_power.sh | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) 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 -- 2.39.2