View Single Post
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:	470
Size:	13.2 KB
ID:	124060   Click image for larger version

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

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

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

Name:	screenshot_2014_06_12T13_54_51+0000.png
Views:	444
Size:	11.8 KB
ID:	124064  
Attached Files
File Type: zip kual-SHOWTIME-v.0.3-All-Kindles.zip (2.1 KB, 245 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