View Single Post
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#18
Originally Posted by HRZ View Post
there's a script/app that "hacks" the screen and forces it to lock *only* when someone is calling. this might be useful for those of you who accidentally touch it while taking it out of your phone.

as for the OP's request I also second that. I'm looking for an app or script that will lock the n900 when i close the keyboard. and please don't tell me its not useful, it's all about preference - isn't that what differentiates the n900 from other phones? the ability to tweak and customize as "I" see fit. How ironic that the n900 should be the phone to have an "I" in front of it's name.
Hi,
you can use dbus-scripts to automatically lock the screen when closing the keyboard.

for example, the script to lock the screen (/home/user/lock_screen.sh):

Code:
#!/bin/bash
SLIDE_PATH=/sys/devices/platform/gpio-switch/slide/state
read SLIDE_STATE < $SLIDE_PATH;

if [ "$SLIDE_STATE" == "closed" ]; then
  run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"locked"
fi
dbus-script event:
/home/user/lock_screen.sh * * org.freedesktop.Hal.Device Condition ButtonPressed cover

Sadly, you can not use the slide button anymore (on the right side of your device)
to unlock the screen while keyboard is closed, as both
(the keyboard and the slide button) emit the same dbus signals.

But pushing the power button and slide2unlock still works.

nicolai