View Single Post
Old 06-20-2014, 05:14 PM   #43
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Okay, got a crappy POC working (thanks to FBGrab & IM).

I'm thinking wrap that in a forever loop, and each 30s check if the time changed, and when it does:

Snapshot of the current page:
Code:
fbgrab page.png
Composite a clock on it (default @ bottom, tweak the size per-device, cf. my BatteryStatus KUAL extension for the screen size detection code):
Code:
/mnt/us/linkss/bin/convert page.png -gravity south -compose src-over -background "#0000" -fill black -font "/usr/java/lib/fonts/Caecilia_LT_75_Bold.ttf" -gravity south -size "600x20" caption:"$(date +%H:%M)" -composite -quality 75 -define png:bit-dept
h=8 clock.png
Print composite page w/o flashing:
Code:
eips -g clock.png
Maaagic!

(Also, cleanup behind us, and write all that crap in a tmpfs, not the flash).

It's crappy because both fbgrab & IM are very CPU-hungry (i.e. the whole process takes between 1~2s @ 100% CPU on a Touch), and the design around a forever loop isn't terribly pretty (but I like the 'check if the time has changed every n seconds' better than a costly & ugly parsing of the logs to detect page changes, and it should be more transparent to the user, since it would then mostly avoid happening during an already CPU-hungry operation [page change] [EDIT: Err, okay, obvious downside: it disappears when you turn the page until the time change]).

Going with a lower PNG compression level (both for FBGrab & IM) would probably speed things up a bit, at the expense of bigger files, which might be something to investigate, since this is only intended for very short-term storage.

For now, I'm leaving this out there, I don't really intend to make anything end-user friendly with this, just throwing ideas around .

Especially since both the real toolbar, or aosd or a proper overlay like the LUA idea would be much, much better .

EDIT: For an idea of what the (mostly randomly chosen) size mentioned gives:

EDIT²: And with Futura-DemiBold instead, to match the font used by the framework on a K5 (don't mind the crappy fake BoldOblique of Libre Baskerville).

EDIT³: We could nearly do it without file I/O, if only eips could handle input from stdin...
Code:
./fbgrab -z 0 - | /mnt/us/linkss/bin/convert PNG:- -gravity south -compose src-over -background "#0000" -fill black -font "/usr/java/lib/fonts/Caecilia_LT_75_Bold.ttf" -gravity south -size "600x20" caption:"$(date +%H:%M)" -composite -quality 00 -defi
ne png:bit-depth=8 PNG:- | eips -g -
Code:
eips: paint_image> cannot open "-":can't fopen
Attached Thumbnails
Click image for larger version

Name:	clockpage.png
Views:	353
Size:	60.0 KB
ID:	124412   Click image for larger version

Name:	futurademiboldclockpage.png
Views:	326
Size:	62.3 KB
ID:	124420  

Last edited by NiLuJe; 06-20-2014 at 09:19 PM.
NiLuJe is offline   Reply With Quote