View Single Post
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#11
So, after the marvellous ideas posted above I have a first, crude version. I don't know yet how much will suck your battery but I'm pretty excited and want to share it.

I know there are many things that should be improved like the commands that should not be in the loop because they are needed only once when the user locks the device (I tried hooking up to dbus-scripts lock event without success) but this is a first step. Also the backlight returns to 128 after unlocking and stays there whatever, but I haven't got around to that yet.

Script must be run as root. When you lock your device a dim time shows up just like on the N9 (with a huge pixelated font, but anyway)

Code:
while true
do
LOCK=$(dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.get_tklock_mode|awk -F "\"" '/g/ {print $2}')

if [ $LOCK == "locked" ]
then
    echo 0 > /sys/class/graphics/fb0/blank
    #uncomment this line for no backlight (darker image, less battery consumption)
    echo 2 > /sys/class/backlight/acx565akm/brightness
    d=`date '+%H:%M'`
    text2screen -t "$d" -s 10 -T 0xFFFFFF -B 0x000000 -x 50 -y 100
    sleep 2
else
   echo 128 > /sys/class/backlight/acx565akm/brightness
fi
done
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jolla –– contactlaunch –– timenow

Nemo UX blog: Grog
My website: qwazix.com
My job: oob

Last edited by qwazix; 2012-04-18 at 17:41.
 

The Following 8 Users Say Thank You to qwazix For This Useful Post: