Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-03-2012, 09:00 PM   #1
dos1
20% cooler.
dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.
 
dos1's Avatar
 
Posts: 92
Karma: 364266
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite
eventHandler - easy way to run scripts on boot and screensaver on/off events

I've just created a small package for Kindle Touch and Paperwhite.
(please note that it's untested on Touch, but it should work)

I don't know if anything like that already exists. I just created it for myself and now decided to learn how to package stuff with kindletool

It's a very simple shell script used to run other shell scripts on particular events - boot, suspend or resume. Boot is self-explanatory, suspend is going to screen saver and resume is returning from screen saver.

After installing eventHandler you'll see a scripts directory created in your user partition. It contains three subdirectories - boot, suspend and resume. When event occurs, eventHandler runs all scripts in directory matching given event.

It's simple as that This gives you possibility to run simple scripts without having to install usb networking and other advanced stuff. You'll just need a jailbreak.

Installing is easy: just put install file in root directory of user partition and select "Update your Kindle" from Settings screen. Uninstalling follows the same pattern.

Package contains also few scripts used by me which can be taken as examples:

Spoiler:
screensaver changes behavior of screen saver rotating from ordered to random. Please note that it expects all wallpapers to be named like bg_medium_ss01.png, with leading zero if number is smaller than 10. Should be put under resume directory.
NOTE: Of course it will only work when Special Offers are disabled. If you have SO Kindle, please don't ask how to remove ads. Figure it by yourself or pay Amazon to remove them. Thank you.

wpa-eap can be used to support WPA-EAP WiFi network with client certificate, like one on my university. You'll need to adapt settings to your configuration - passphrase, paths to certificates etc. Should be put under both boot and resume directory.

rss can be used to emulate push-to-Kindle functionality from Amazon, but using your own server. It allows you for instance to synchronize your Kindle with automatically generated RSS feeds from Calibre without duplicated entries, like it happens when using Amazons e-mail pushing. It uses titlebar notifications and checks for timestamp to minimize battery usage on each resume, so it won't synchronize when not needed. Again, you'll need to configure it. It will work without any changes, but you probably don't want to synchronize with my feeds (I left my configuration to allow you checking by yourselves how it should be configured on the server). It stores files in /mnt/us/documents/RSS


Please note that example scripts are only tested on Paperwhite.

NOTE: eventHandler runs all your scripts as root, so be careful with what you include in your scripts! Running "rm -rf /" isn't probably a good idea

If you have Kindle Touch or Kindle Paperwhite, install kindle5 version.
If you have non-touch Kindle 4, install kindle4 version.
Please note that Kindle 4 version is untested!

Enjoy!

[edit]
Updated to 0.11 version which should fix bug reported by stepk and which brings (untested) install files for Kindle 4 (non-touch).

[edit]
Updated to 0.2 version which now works properly with magnetic cover.
Attached Files
File Type: gz eventHandler-0.2.tar.gz (16.3 KB, 42 views)

Last edited by dos1; 03-01-2013 at 06:20 PM. Reason: update to 0.2
dos1 is offline   Reply With Quote
Old 12-03-2012, 09:02 PM   #2
qlob
Horse
qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.qlob ought to be getting tired of karma fortunes by now.
 
qlob's Avatar
 
Posts: 1,019
Karma: 7087247
Join Date: Apr 2012
Device: Kindle3G+WiFi
It's almost like Kite! (but lacking in the launching scripts from the home screen area...)

Looks fancy though... It would be cool to write this for the K3 or K4 as well.
qlob is offline   Reply With Quote
 
Enthusiast
Old 12-04-2012, 02:13 PM   #3
stepk
Groupie
stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.
 
Posts: 150
Karma: 511590
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
Thanks for this. Unfortunately install.sh fails on my KT because it assumes that /usr/local exists, while it really doesn't - on my almost untouched KT.
stepk is offline   Reply With Quote
Old 12-04-2012, 02:17 PM   #4
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: 5,143
Karma: 5328985
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|Ematic E6+E8|Rooted Nook Touch|NO K2!!
I had an issue in DIAGS where it (booting diags) would clean down my /usr/local

Never not had one. Good point though.

best to do a [ -e ] or z or f or whatever I suppose

YAY CORNER CASES!
__________________
Audiophile and electron bully.
My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK
Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him.
The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set
twobob is offline   Reply With Quote
Old 12-04-2012, 02:51 PM   #5
dos1
20% cooler.
dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.
 
dos1's Avatar
 
Posts: 92
Karma: 364266
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite
Quote:
Originally Posted by stepk View Post
Thanks for this. Unfortunately install.sh fails on my KT because it assumes that /usr/local exists, while it really doesn't - on my almost untouched KT.
Should be now fixed, could you try again please?

BTW. I've included version for Kindle 4, could someone test if it works? (note that example scripts probably won't work without adjusting)
dos1 is offline   Reply With Quote
Old 12-04-2012, 03:16 PM   #6
stepk
Groupie
stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.
 
Posts: 150
Karma: 511590
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
OK, it's working now, thanks.
How do you generate the server content for the rss feed script? I mean, do you run the calibre client on a debian box and save generated .pobi files to the http server, or do you run calibre as a content server?
stepk is offline   Reply With Quote
Old 12-04-2012, 03:17 PM   #7
dos1
20% cooler.
dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.
 
dos1's Avatar
 
Posts: 92
Karma: 364266
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite
Quote:
Originally Posted by stepk View Post
OK, it's working now, thanks.
How do you generate the server content for the rss feed script? I mean, do you run the calibre client on a debian box and save generated .pobi files to the http server, or do you run calibre as a content server?
I have installed Calibre on my VPS and created cron jobs for updating pobi files in specified directory, which is exported to the world via rsync daemon.
dos1 is offline   Reply With Quote
Old 03-01-2013, 06:22 PM   #8
dos1
20% cooler.
dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.
 
dos1's Avatar
 
Posts: 92
Karma: 364266
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite
0.2 version is now up - I've fixed a bug which prevented scripts from being launched when using magnetic cover. Enjoy!
dos1 is offline   Reply With Quote
Old 03-01-2013, 11:20 PM   #9
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: 5,143
Karma: 5328985
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|Ematic E6+E8|Rooted Nook Touch|NO K2!!
ROCK HANDS!!!
__________________
Audiophile and electron bully.
My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK
Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him.
The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set
twobob is offline   Reply With Quote
Old Yesterday, 07:36 AM   #10
Vava
Junior Member
Vava began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2013
Device: PaperWhite
Thanks you for this package !
I have an issue with the startup script. I would like to run a web browser (this one http://www.mobileread.com/forums/sho...d.php?t=210210) at startup. The application is well opened but few secondes later the classic menu comes back. When I launch it from the suspend or resume script, it works fine. My first guess was that the browser finished his launching before the Kindle. Did you ever notice this kind of problem ?
Vava is offline   Reply With Quote
Old Yesterday, 07:39 AM   #11
thomass
Wizard
thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.
 
Posts: 1,417
Karma: 1358805
Join Date: Mar 2011
Location: Türkiye
Device: Kindle 5.3.2.1
Quote:
Originally Posted by Vava View Post
The application is well opened but few secondes later the classic menu comes back.... My first guess was that the browser finished his launching before the Kindle.
you can try to use a pause function (sleep) on the script.
thomass is offline   Reply With Quote
Old Yesterday, 08:15 AM   #12
Vava
Junior Member
Vava began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2013
Device: PaperWhite
I did but it seems that the browser begin his launching anyway, then the function sleep hold and at the end the menu shows up. (I place the sleep function before my call to the browser)
Vava is offline   Reply With Quote
Reply

Tags
events, k5 tools, kindle, kite, screensaver

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
K5 is it possible to run k5 launchpad scripts on k5 techiemonkey Kindle Developer's Corner 3 07-30-2012 09:10 AM
Kite on K3G launches scripts randomly on boot or unplug jmseight Kindle Developer's Corner 0 03-23-2012 01:55 PM
Kindle tries to run C/++ applications like sh scripts? dnR Kindle Developer's Corner 1 01-09-2011 07:45 AM


All times are GMT -4. The time now is 04:20 AM.


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