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).
/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
#!/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