Reply
Thread Tools
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 Jollacontactlaunchtimenow

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:
Posts: 701 | Thanked: 585 times | Joined on Sep 2010 @ London, England
#12
Nice start. You need to fix the LOCK= line in that code which I guess didn't copy and paste correctly. I tried using the dbus line to query lockstate from the wiki, but that always seems to return "unlocked" for me even when locked for both my N900s (could be something I've done, which I'll look into later). Anyway, I tried the middle part of the code over ssh and that's fine but the size of the time could be bigger.
 

The Following 3 Users Say Thank You to retsaw For This Useful Post:
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#13
Yes, that's an error while copying from nano. Editing now. For the size change -s 10 to a number of your liking in the line starting with text2screen.
By the way after having the phone in my pocket for some time it started showing the time over the lockscreen, which is very nice because it shows the notifications too but I am trying to reproduce it some time now and I can't.
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jollacontactlaunchtimenow

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

The Following 4 Users Say Thank You to qwazix For This Useful Post:
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#14
Originally Posted by MohammadAG View Post

Optionally, this enables the touchscreen.
Code:
echo 0 > /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts
I modified the script to mimic more the N9 behaviour and unlock with double click. So far I've been able to configure xbindkeys to detect double taps and run a script, to run xbindkeys when locked and kill it when unlocked, but when I do double tap on the "idle" screen nothing happens (xbindkeys does not notice any taps, I can see the verbose console output afterwards) does this happen because the screen is painted with the framebuffer? should xbindkeys register something? Of course I have included the above line in the script.
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jollacontactlaunchtimenow

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

The Following User Says Thank You to qwazix For This Useful Post:
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#15
It seems that I overdid it and took care of things I shouldn't. This one works better, as it doesn't mess with default brightness settings

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
    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
fi
done
I also tried to convert some bmp's to raw images for catting to fb0 with a bmp2raw I found somewhere on the net but it dumps the image scrambled. I suppose that the framebuffer doesn't have 800x480 resolution as the image doesn't fill up the screen.

That's all for now. Time to go to bed.
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jollacontactlaunchtimenow

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

Last edited by qwazix; 2012-04-18 at 22:56. Reason: else clause not needed
 

The Following 6 Users Say Thank You to qwazix For This Useful Post:
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#16
Originally Posted by qwazix View Post
I modified the script to mimic more the N9 behaviour and unlock with double click. So far I've been able to configure xbindkeys to detect double taps and run a script, to run xbindkeys when locked and kill it when unlocked, but when I do double tap on the "idle" screen nothing happens (xbindkeys does not notice any taps, I can see the verbose console output afterwards) does this happen because the screen is painted with the framebuffer? should xbindkeys register something? Of course I have included the above line in the script.
Did you enable the touchscreen with my last command in the first post? The display can be on with the ts off.
 

The Following 3 Users Say Thank You to MohammadAG For This Useful Post:
ammyt's Avatar
Posts: 1,918 | Thanked: 3,118 times | Joined on Oct 2010 @ My pants
#17
Originally Posted by MohammadAG View Post
If you're not interested in the UI you can play a video in mplayer as well.
Code:
mplayer -vo fbdev videofile
Hehehe, a bit too much for a standby screen eh?
 
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#18
Originally Posted by MohammadAG View Post
Did you enable the touchscreen with my last command in the first post? The display can be on with the ts off.
Yes I did that, but still xbindkeys does not read anything. Also the script eats too much cpu so I'll have to make it work with dbus-scripts. Maybe a sleep of a couple of seconds before issuing the commands would help
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jollacontactlaunchtimenow

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

The Following 2 Users Say Thank You to qwazix For This Useful Post:
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#19
Originally Posted by qwazix View Post
Yes I did that, but still xbindkeys does not read anything. Also the script eats too much cpu so I'll have to make it work with dbus-scripts. Maybe a sleep of a couple of seconds before issuing the commands would help
Have you considered using Queen Bee Widget with it? It has dbus monitoring, and can be set to do periodic updates. I don't know if they still get time updates when hildon is alseep, but may be worth a try. I'll give it a shot tonight and let you know how things work if I get a chance.

Edit:
In fact, yes... it does work.

I stripped the shell script to:
Code:
#!/bin/sh

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}')

time=`date '+%I:%M'`
day=`date '+%m/%d/%y'`
till=3600

if [ $LOCK == "locked" ]
then
    echo "echo 0 > /sys/class/graphics/fb0/blank" | sudo gainroot >/dev/null
    #echo 2 > /sys/class/backlight/acx565akm/brightness
    text2screen -t "$time" -s 10 -T 0xFFFFFF -B 0x000000 -x 50 -y 100
    text2screen -t "$day" -s 10 -T 0xFFFFFF -B 0x000000 -x -600 -y 350
    till=30;
fi

if [ $2 == "QBW_DBUS_MONITOR"  -o $till -gt 100  ]
then
    id="/oh/no/more/qbw"$1
    dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'delayIndex' uint32:9 string:''
    dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'customIntervalSecs' uint32:$till string:''
    dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.reset_rearm_timer
fi


return 0
The QBW widget I setup is here:

Code:
[queen-beecon-header]
version=1.000000
checksum=3330600
[queen-beecon-exported-instance]
widgetType=0
widgetVisible=0
operationalStatus=0
hideCanvas=true
hideClickCanvas=true
snippetBgRGB=0
snippetExtBgRGB=#000000000000
beecon_lt0_ImgZoom=0
beecon_lt0_BgRGB=2
beecon_lt0_ExtBgRGB=#808080808080
beecon_lt0_ImgFilename=queen-beecon-syserr.png
beecon_eq0_ImgZoom=0
beecon_eq0_BgRGB=3
beecon_eq0_ExtBgRGB=#0000ffff0000
beecon_eq0_ImgFilename=queen-beecon-appok.png
beecon_eq1_ImgZoom=0
beecon_eq1_BgRGB=4
beecon_eq1_ExtBgRGB=#ffffffff0000
beecon_eq1_ImgFilename=queen-beecon-appwrn.png
beecon_ge2_ImgZoom=0
beecon_ge2_BgRGB=5
beecon_ge2_ExtBgRGB=#ffff00000000
beecon_ge2_ImgFilename=queen-beecon-apperr.png
beecon_idxge2_ImgZoom=0
beecon_idxge2_BgRGB=11
beecon_idxge2_ExtBgRGB=#0000ffffffff
beecon_idxge2_ImgFilename=queen-beecon-index.png
widWidth=64.509316770186331
widHeight=64.551083591331263
instanceTitle=screen-time
instanceCmd=/root/scripts/scrlockclock.sh
rememberMe=
cmdImgFilename=queen-beecon.png
cmdImgAngle=0
cmdImgZoom=0
cmdFgRGB=1
cmdExtFgRGB=#ffffffffffff
cmdTextAngle=0
cmdVisibilityPosition=2
cmdImgVisibilityPosition=5
cmdJustify=0
cmdExtFont=Nokia Sans bold italic 12
cmdFontName=3
cmdFontSize=12
resImgFilename=queen-beecon-resimg.png
resImgAngle=0
resImgZoom=0
resFgRGB=1
resExtFgRGB=#ffffffffffff
resTextAngle=0
resVisibilityPosition=8
resImgVisibilityPosition=3
resJustify=0
resExtFont=Nokia Sans Cn  10
resFontName=16
resFontSize=10
resWrapLongLines=false
progressAnimationFrames=4
progressAnimationTimer=4
progressAnimationPos=4
progressAnimationAtClickXY=false
progressAnimationBasename=queen-beecon-progress
updOnStartup=false
updOnClick=false
multiClick=false
updOnDesktop=false
updOnSight=false
updOnOrientation=false
delayIndex=1
customIntervalSecs=0
updNeworkPolicy=0
GPSsettings=0
updOnDBUS=1
updOnDBUSBus=0
updOnDBUSMatchRule=type='signal',path='/com/nokia/mce/signal',interface='com.nokia.mce.signal',member='tklock_mode_ind'

Last edited by woody14619; 2012-04-23 at 20:15. Reason: Fixed the busted parts. :)
 

The Following 6 Users Say Thank You to woody14619 For This Useful Post:
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#20
Another idea is to build images with imagemagick and have them displayed on the framebuffer with mplayer, so that icons, better fonts etc are possible. I'll look into it probably in the weekend
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jollacontactlaunchtimenow

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

The Following User Says Thank You to qwazix For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 18:35.