On some KUAL apps (like "draw"), physical power button has been used on KindleTouch and PW to execute some commands, like exiting the program. This was a bit annoying, because put the device into screensaver mode and user had to wake up the device later, by hand. To avoid this, just add to dbus-monitor event commands this one:
Code:
lipc-set-prop com.lab126.powerd powerButton 1
Screensaver won't show and user won't have to manually wake up the device. He will see only the light flashing on PW, for a minimal amount of time (maybe also this can be fixed, but is quite good as visual feedback too).
Sample KUAL app attached ("draw", renamed to "whiteboard" for the occasion)
App script:
Code:
#!/bin/sh
SSSTATE=`lipc-get-prop com.lab126.powerd preventScreenSaver`
lipc-set-prop com.lab126.powerd preventScreenSaver 0
/usr/bin/xtestlab126 &
( dbus-monitor "interface='com.lab126.powerd',member='goingToScreenSaver'" --system; killall xtestlab126; lipc-set-prop com.lab126.powerd powerButton 1; lipc-set-prop com.lab126.powerd preventScreenSaver "$SSSTATE" ) &
usleep 50000
killall -INT dbus-monitor
General approach:
Code:
( dbus-monitor "interface='com.lab126.interfaceName',member='interfaceEvent'" --system; lipc-set-prop com.lab126.powerd powerButton 1; yourCommandsHere) &