06-13-2014, 03:42 PM | #31 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Well I went off and found some c that blats stuff in and out of the buffer decently enough. for the 3 pictured)
perhaps a slightly less damn ugly eips alternative wouldnt actually go that far amiss... tried messing with pgm. that might be a cheap alternative to real data? dpavlin did a perl script that mangled pgm via perl back into native 4bit framebuffer. might that be a useful touchstone? I gave it the once over. so "pseudo cat pgm data" to fb0[susectionx][subsectiony] and update? just spitballing, does actually sound very useful. Last edited by twobob; 06-13-2014 at 10:55 PM. |
06-13-2014, 05:41 PM | #32 |
Wizard
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
I'm currently fiddling with a script that should intercept (via LD_PRELOAD) mmap/ioctl calls - mainly to recreate something like the "Kobo night mode" hack for the Kindle. I like it to be more hackable, so I interface it with LuaJIT. When that is done, I can use that also to display a clock. I have everything ready, since we have FreeType interfacing for Koreader already and it shouldn't be too hard to integrate. Then we have scalable antialiased truetype fonts for clocks. Well, and night mode :-)
|
06-13-2014, 06:01 PM | #33 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
well said. *leaves framebuffer code alone*
|
06-13-2014, 07:01 PM | #34 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
it was so obvious.
root@kindle bin]# ./wmctrl -r -i `./wmctrl -l | awk '/titleBar/ {print $1 } '` -b toggle above I think that covers it. EDIT hmm bit hasty need to persist it somehow... Last edited by twobob; 06-13-2014 at 07:29 PM. |
06-13-2014, 07:43 PM | #35 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
ok so...
export i=`xwininfo -tree -root | awk '/titleBar/{print $1}'` \ && ./xdotool windowreparent $i `xwininfo -tree -root | awk '!/footerBar/ && /booklet.reader/{print $1}'` and export i=`xwininfo -tree -root | awk '/titleBar/{print $1}'` && ./xdotool windowreparent $i 0x51 to go back to normal. and they are one-off stateful calls. no log tailing. maybe we could detect book exit.... hmm... I'll bundle the tools in a bit. They are all in The Touch management bundle but I'll repack them for this I guess Last edited by twobob; 06-13-2014 at 07:53 PM. Reason: tidier. one less process |
06-13-2014, 09:31 PM | #36 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Something like:
PHP Code:
with:showtime-header.sh PHP Code:
and:showtime-restore.sh PHP Code:
dynamically sticks the top status bar over the book while reading. Possible to resize it a tiny bit smaller / move it around/ via xdotool. Last edited by twobob; 06-13-2014 at 11:00 PM. |
06-13-2014, 11:33 PM | #37 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@twobob: Duh! Of course that titlebar still does its job in the background. Nice! >_<".
Does it refreshes properly? |
06-14-2014, 07:56 AM | #38 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
I literally just got that finished and crashed out. zero testing was done. and that was just on the touch / PW obviously.
Tried an alpha channel gtk app for the 3 but for some reason I cant even get the alpha channel stuff working on my main pc never mind the 3. that would be a neat solution though - a transparent notifications layer, that doesnt grab focus. would be nice to programmatically inject full widgets on the fly to an overlay. perhaps this LUA solution I should just just hang around for... |
06-14-2014, 08:04 AM | #39 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
wait. didnt i build an OSD app for this stuff ages ago???
hmm...*thinks* |
06-16-2014, 02:17 AM | #40 |
Addict
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
|
|
06-16-2014, 07:03 AM | #41 |
Wizard
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
As for the night mode (and my development work regarding this): It's a bit harder than I thought. I'm still hunting for the exact place where the screen updates are triggered in the originial software stack. OK, I'm also overengineering this a bit, as I usually do with my private side projects :-) But this is getting OT here. I'll start a new thread regarding night mode when I have a tad bit more to show.
|
06-16-2014, 08:10 AM | #42 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
I think that they are triggered by the LUA in the damage section IIRC.
|
06-20-2014, 05:14 PM | #43 |
BLAM!
Posts: 13,477
Karma: 26012492
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 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 Code:
eips -g clock.png (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 Last edited by NiLuJe; 06-20-2014 at 09:19 PM. |
06-20-2014, 10:00 PM | #44 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Okay, I lied.
Code:
#! /bin/sh # # $Id$ # # Fugly POC # Be nice! renice -n 10 $$ # Do some minimal device checks... # Use Futura if it exists if [ -f "/usr/java/lib/fonts/Futura-DemiBold.ttf" ] ; then CLOCK_FONT="/usr/java/lib/fonts/Futura-DemiBold.ttf" else # Barring that, go with Caecilia, because Helvetica is friggin awful. CLOCK_FONT="/usr/java/lib/fonts/Caecilia_LT_75_Bold.ttf" fi # Detect the correct screen size... (Adapted from the logic in BatteryStatus) kmodel="$(cut -c3-4 /proc/usid)" case "${kmodel}" in "24" | "1B" | "1D" | "1F" | "1C" | "20" | "D4" | "5A" | "D5" | "D6" | "D7" | "D8" | "F2" ) # PaperWhite... SCREEN_X_RES=758 SCREEN_Y_RES=1024 ;; * ) # Handle legacy devices... if [ -f "/etc/rc.d/functions" ] && grep "EIPS" "/etc/rc.d/functions" > /dev/null 2>&1 ; then . /etc/rc.d/functions else # Touch SCREEN_X_RES=600 # _v_width @ upstart/functions SCREEN_Y_RES=800 # _v_height @ upstart/functions fi ;; esac # NOTE: Mostly randomly chosen, tweak me if needed case "${SCREEN_Y_RES}" in "800" ) CLOCK_SIZE="${SCREEN_X_RES}x20" ;; "1200" ) # FIXME: Can't remember if /etc/rc.d/functions is actually accurate on DX/DXG, or if we need to fake it ourselves CLOCK_SIZE="${SCREEN_X_RES}x30" ;; "758" ) CLOCK_SIZE="${SCREEN_X_RES}x26" ;; esac # And the actual work... clock_watch() { LAST_TIME="13:37" # Let's loop! while : ; do # Check the time... CURRENT_TIME="$(date +%H:%M)" if [ "${CURRENT_TIME}" != "${LAST_TIME}" ] ; then # It changed, draw the clock! LAST_TIME="${CURRENT_TIME}" # Start by building a composite of the current screen w/ a clock at the bottom (Kill the undercolor if annoying. Useful when the time changes on the same page). /mnt/us/usbnet/bin/fbgrab -z 0 - 2>/dev/null | /mnt/us/linkss/bin/convert PNG:- -gravity south -compose src-over -background "#0000" -fill black -font "${CLOCK_FONT}" -undercolor white -gravity south -size "${CLOCK_SIZE}" caption:"${CURRENT_TIME}" -composite -quality 00 -define png:bit-depth=8 /var/tmp/clock.png # And then print it, without flashing eips -g /var/tmp/clock.png # And clean up behind us rm -f /var/tmp/clock.png fi # See you in thirty! sleep 30 done return 0 } # Sneakily launch the clock watch in the background clock_watch & echo "* Clock watch backgrounded w/ PID $!" # See ya' exit 0 Last edited by NiLuJe; 06-20-2014 at 10:15 PM. |
06-21-2014, 11:45 AM | #45 |
Addict
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
|
very nice screenshots niluje!
i'm curious, what fonts and sizes are needed to make it look stock, so that it is the same font/size as the location and percent text? |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-T1 Check the time while reading (clock feature) | Dterm | Sony Reader | 24 | 03-18-2013 07:34 PM |
Persistant Errors with 0.8.16 | jimnee | Conversion | 2 | 08-30-2011 04:14 PM |
A Clock? | Joefitch | Kindle Developer's Corner | 7 | 05-31-2011 10:43 AM |
Against the clock | boxcorner | General Discussions | 5 | 04-09-2011 10:08 PM |
Anyway to display the clock while reading a book? | Mallaur | Sony Reader | 2 | 01-27-2009 08:35 AM |