Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-12-2014, 09:56 AM   #16
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
kual-SHOWTIME-v.0.1-All-Kindles

meh so I did it to show what I meant.

a learning exercise now if you can be bothered to read...

tl; dr: The extension is below.


It displays at the top.
It just parses the log and shoves up a time when the page is triggered.

I re-factored all the external scripts out and made it a one hit wonder.

PHP Code:
#!/bin/bash
if [ -/sys/devices/platform/mxc_epdc_fb/graphics/fb0 ]
    
then
PLATFORM
="$(cat /sys/devices/platform/mxc_epdc_fb/graphics/fb0/modes)"
    
else
PLATFORM=""
fi

echo $PLATFORM

if [ ! -/sys/devices/platform/mxc_epdc_fb/graphics/fb0 then
# it's probably something ancient

    
if [ ! -/proc/fiveway_wake ] ; then
        
echo "k2 or something detected"

# This next part says, "Clear Log" then 
# "Push the new log, line by line, into awk" then 
# "If a certain line is matched by awk get awk to run eips via the shell"

        
&> /var/log/messages && 2>/dev/null tail -/var/log/messages | \
awk '/.*PageAction*./ || /.*acxmgrd*./ || /.*NextPage*./ || /.*Reader*./ {system("eips 20 0 `date +%T`")}   '

        
exit 0
else
        echo 
"k3 or k4 or something detected"

        
&> /var/log/messages && 2>/dev/null tail -/var/log/messages | \
awk '/.*PageAction*./ || /.*acxmgrd*./ || /.*NextPage*./ || /.*Reader*./ {system("eips 20 0 `date +%T`")}   '
        
exit 0
    fi
fi

if [ -/sys/devices/platform/mxc_epdc_fb/graphics/fb0 ]
    
then
    
if [ "$PLATFORM!= "${PLATFORM/758/}
        
then
        
echo "PW detected"

        
# eips 25 41 `date +%T`"   Would be middle bottom offset from amazon readout on a PW, we went with top middle.  
        
&> /var/log/messages && 2>/dev/null tail -/var/log/messages exec parselog | \
awk '/.*PageTurnAction*./ || /.*JunoExecutionManager*./  {system("eips 20 0 `date +%T`")}  '
        
exit 0
    
else
        
# it's something else, probably older
        
echo "Generic detected"

        
&> /var/log/messages && 2>/dev/null tail -/var/log/messages exec parselog | \
awk '/.*PageAction*./ || /.*PageTurnAction*./ || /.*acxmgrd*./ {system("eips 20 0 `date +%T`")}  '
        
exit 0
    fi
fi 


Should work. Probably needs love on some devices with the showlog -f matches. feedback and testing happily accepted.

Enjoy.

If you want the display in a different place on a certain device just fiddle with the X Y on the eips.
(1st two parameters)

CHANGELOG:

0.1 First release.
0.2 Added: "PageTurnAction" to Kindle Touch matches to handle Amazon revision changes.
0.3 Switched to bash for comparison, added dir test.
Attached Thumbnails
Click image for larger version

Name:	screenshot_2014_06_12T13_40_48+0000.png
Views:	413
Size:	13.2 KB
ID:	124060   Click image for larger version

Name:	screenshot_2014_06_12T13_54_44+0000.png
Views:	379
Size:	11.7 KB
ID:	124061   Click image for larger version

Name:	screenshot_2014_06_12T13_40_02+0000.png
Views:	386
Size:	40.8 KB
ID:	124062   Click image for larger version

Name:	screenshot_2014_06_12T13_40_15+0000.png
Views:	392
Size:	41.5 KB
ID:	124063   Click image for larger version

Name:	screenshot_2014_06_12T13_54_51+0000.png
Views:	394
Size:	11.8 KB
ID:	124064  
Attached Files
File Type: zip kual-SHOWTIME-v.0.3-All-Kindles.zip (2.1 KB, 197 views)

Last edited by twobob; 06-12-2014 at 10:39 PM. Reason: [use bash for substitution] tidied up code a bit
twobob is offline   Reply With Quote
Old 06-12-2014, 02:38 PM   #17
Huku
Member
Huku began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
twobob,
you have no idea how happy you made me. Going to try this tonight! Thank you!
Huku is offline   Reply With Quote
Advert
Old 06-12-2014, 02:47 PM   #18
elchamaco
Zealot
elchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enough
 
Posts: 128
Karma: 500
Join Date: Aug 2011
Device: kindle, boox
I tried it, changed the values the max low position seems to be the 41 as you say in the script but it crosses with the text using kaznelsoft margins hack.

It's possible to show only Hour and minutes?
It's possible to put the clock in a lower position?

Great job.

Quote:
I answer myself the first question, change %T for %H:%M to see Hour an minutes but not seconds.
http://pubs.opengroup.org/onlinepubs...ties/date.html

Last edited by elchamaco; 06-12-2014 at 02:57 PM.
elchamaco is offline   Reply With Quote
Old 06-12-2014, 02:56 PM   #19
Huku
Member
Huku began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Yep, working on Kindle Paperwhie 5.4.2 :-) :-)
Is there any way to change the font of the displayed time to smaller? (just going to play a little bit with the position)
On my device clock is shown only when I go to next page. If I go to previous page it is not shown. Not a big deal just mention.

Aslo have the overlap problem.

Last edited by Huku; 06-12-2014 at 03:07 PM.
Huku is offline   Reply With Quote
Old 06-12-2014, 03:15 PM   #20
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,480
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@elchamaco: 1024 / 24 == 42; and it's 0 indexed, so, nope.

@Huku: No. Think of it as a bitmap font.

To fix it would require a more complex solution. (ie. a real clock app overlay, or an insane hack based around IM generated transparent png [scratch that, eips doesn't handle alpha]).

Last edited by NiLuJe; 06-12-2014 at 03:30 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 06-12-2014, 03:15 PM   #21
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
That's why I put it at the top.

No way to change the eips sizes that I know of.

it might be possible to output to the framebuffer via a different. much tidier method. like a custom c app that uses some other backend to render the text. Cairo?

Like I said, horrible hack.
twobob is offline   Reply With Quote
Old 06-12-2014, 03:18 PM   #22
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
hmm... maybe the framebuffer could be moved slightly, written to, and moved back. but it would look horrific ;D
twobob is offline   Reply With Quote
Old 06-12-2014, 03:22 PM   #23
Huku
Member
Huku began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Thanks guys.
It also overlaps when on the top (even more). I am going to put it again at the bottom - the overlap there is smaller.
I found a small problem (not sure if small). My device is PaperWhite but it is detected as "k2 or something detected" :

if [ ! -e /proc/fiveway_wake ] ; then

echo "k2 or something detected"

echo "" > /var/log/messages; tail -f /var/log/messages 2>/dev/null | \
awk '/.*PageAction*./ || /.*acxmgrd*./ || /.*NextPage*./ || /.*Reader*./ {system("eips 40 0 `date +%H:%M`")} '
exit 0

I mean this portion of code is the one that affects the clock when I make changes. Which is probably the reason for showing the clock only when page forwards but not on page backwards.
Huku is offline   Reply With Quote
Old 06-12-2014, 03:23 PM   #24
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
oh.

[ -d /sys/devices/platform/mxc_epdc_fb/graphics/fb0 ] && echo "PW"

does that work? in a shell?

Last edited by twobob; 06-12-2014 at 09:52 PM. Reason: &&
twobob is offline   Reply With Quote
Old 06-12-2014, 03:32 PM   #25
Huku
Member
Huku began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
hm... not sure how to run shell here :-(
Huku is offline   Reply With Quote
Old 06-12-2014, 03:55 PM   #26
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
For now: just remove all the other "IF"s since you know what you want...

Ill post it here,.


PHP Code:
#!/bin/bash

&> /var/log/messages && 2>/dev/null tail -/var/log/messages exec parselog | \
awk '/.*PageTurnAction*./ || /.*JunoExecutionManager*./ {system("eips 20 0 `date +%T`")}' 

just run with that.

remove everything else.

I'll think about why that might happen at some point, but that would fix it for now - to only work on a paperwhite, dumbly, without detection.

Just edit the file: /mnt/us/extensions/showtime/bin/showtime.sh
or <THE_KINDLE_ON_YOUR_PC>/extensions/showtime/bin/showtime.sh

You can run stuff directly in the backend using nilujes usbnet modification via kual or directly.from its installer. (session pictured via wifi)
Attached Thumbnails
Click image for larger version

Name:	ssh-session-to-paperwhite-over-wifi.png
Views:	225
Size:	35.9 KB
ID:	124082  

Last edited by twobob; 06-12-2014 at 10:01 PM. Reason: slimmed it
twobob is offline   Reply With Quote
Old 06-12-2014, 10:24 PM   #27
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
Okay I updated the main thing. hopefully its more robust now.

works on my stuff. For what thats worth.

I have no margin hacks as you can see which tbh, works fine for me.
Sorry eips is not the perfect answer for this job, some swanky injection would be, but we all know how amazon feel about that.

Given minimum effort this is a working solution for me. I was just hoping to draw a few more people into tinkering with the works, it's really not that tricky.

There are certainly more involved solutions that could do a better job however POC of how to attach to each page turn with some crappy text is as far as I go I'm afraid.

Last edited by twobob; 06-12-2014 at 10:27 PM.
twobob is offline   Reply With Quote
Old 06-12-2014, 10:51 PM   #28
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
Niluje? Can you ImageMagick up some swanky time png with transparent background? programagically.

Then we could just use the eips (also utterly broken) graphics capability to mangle it over much more precisely. Just a thought. You being Mr. Python and everything. ooh ooh ; lets OR it with the framebuffer, make it psychedelic.

I can see how easy it would be to spend a long time on this... oh yes..

Then I think we should implement encrypted unix sockets for remote Page-Turn time logging... heh.

Beowulf clustered

Last edited by twobob; 06-12-2014 at 11:03 PM.
twobob is offline   Reply With Quote
Old 06-13-2014, 12:33 AM   #29
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
better yet, an animated gif using the numerals from Predator 2.
well, one of those movies that displayed numerals as bar patterns (base 8?).

Edit, yes, Predator 2 - see the "Hanging On" clip from the movie:
http://www.imdb.com/rg/VIDEO_PLAY/LI.../vi2731737113/

Last edited by knc1; 06-13-2014 at 12:43 AM.
knc1 is offline   Reply With Quote
Old 06-13-2014, 10:57 AM   #30
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,480
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@twobob: I tried. I can generate an appropriately sized & laid out transparent PNG with a single IM call (in ~1s, because drawing text is expensive), but eips -g doesn't handle transparency, so, poof, black screen xD.

EDIT: Meh. Did that on the desktop, not the laptop, and it's currently booted on Winshmooze. I'll pull the call from my history next time I reboot.

Last edited by NiLuJe; 06-13-2014 at 10:59 AM.
NiLuJe is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 08:11 AM.


MobileRead.com is a privately owned, operated and funded community.