View Single Post
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#1361
Originally Posted by coredumb View Post
sorry, i forgot to say that my script is call by the rule you mention above.

i use this command:
Code:
/usr/sbin/dbus-send --system --type=method_call --dest=com.nokia.mce --print-reply=literal /com/nokia/mce/request com.nokia.mce.request.get_inactivity_status
to identify whether the system_inactivity_ind occurs when the device becomes active (return false) or going to sleep (return true).
aaaah, I understand. To address that issue I simply checked if the screen is dimmed AND the keyboard is closed.

Code:
#!/bin/sh
#check screen is off:
brightness=$(cat /sys/class/backlight/acx565akm/brightness)
#check keyboard closed:
keyboard=$(cat /sys/devices/platform/gpio-switch/slide/state)
if [ "$brightness" == "0" ]; then
        if [ "$keyboard" == "closed" ]; then
                #do some stuff
        fi
fi
This way, if I was actually doing something that and did not want the device to run the script I would just leave the keyboard open.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.