View Single Post
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#1
Status: startuplock 1.1.0: added the same code to /etc/X11/Xsession.d/08startuplock

Code:
$ cat /etc/event.d/startuplock 
start on started hildon-desktop
console none
service

script

proximity_state="`cat /sys/devices/platform/gpio-switch/proximity/state`"

if [ "$proximity_state" = "closed" ]; then
  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

end script
Currently in case you are starting the phone on the move and have to put it to a pocket you can't be sure that nothing will be clicked accidentally. This script locks the screen on startup in case proximity sensor reports being closed. Plus it can also save some tiny amount of energy in case you are rebooting the phone often.

I'm currently on the move myself, will package it in several hours.

Last edited by int_ua; 2013-10-17 at 08:11.
 

The Following 14 Users Say Thank You to int_ua For This Useful Post: