View Single Post
Old 12-03-2012, 10: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: 364538
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, 309 views)

Last edited by dos1; 03-01-2013 at 07:20 PM. Reason: update to 0.2
dos1 is offline   Reply With Quote