Quantcast
Channel: MobileRead Forums - Kindle Developer's Corner
Viewing all articles
Browse latest Browse all 4430

K5 eventHandler - easy way to run scripts on boot and screensaver on/off events

$
0
0
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


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 ;)

Enjoy!

PS. eventHandler should also work with Kindle 4 and maybe older Kindles, but AFAIK they don't use upstart so different start script would have to be written.

Attached Files
File Type: gz eventHandler_0.1.tar.gz (13.5 KB)

Viewing all articles
Browse latest Browse all 4430

Trending Articles