a few helpful tips. (i made a custom dynamic screensaver generator, and ran into many of the same issues)
you can unload the amazon screensaver module with lipc allowing the kindle to suspend without showing a screensaver by
Code:
lipc-set-prop -s com.lab126.blanket unload screensaver
and when bailing out a corresponding
Code:
lipc-set-prop -s com.lab126.blanket load screensaver
this module also takes care of refreshing the screen on wake-up so take care when disabling it
you can then register for sleep and wakeup events and trigger your script on wakeup and then resetting the wakeup timer & going back to sleep all with lipc
Code:
lipc-wait-event -m com.lab126.powerd goingToScreenSaver,wakeupFromSuspend,readyToSuspend | while read event; do
case "$event" in
goingToScreenSaver*)
custom_function;;
wakeupFromSuspend*)
custom_function;;
readyToSuspend*)
custom_function;;
esac
done;
to set the wakeup timer use
Code:
lipc-set-prop com.lab126.powerd rtcWakeup xxx
replacing xxx with a integer amount. one limitation. this property can only be set in the
readyToSuspend state.
the kindle suspend state cycle is like this:
Awake -> goingToScreenSaver -> ScreenSaver -> readyToSuspend -> Suspended -> wakeupFromSuspend -> ScreenSaver -> outOfScreenSaver -> Awake
i am not sure how long the kindle spends in the ScreenSaver & readyToSuspend states. it might be longer than a minute and therefore useless to you. however you can try what what koreader does to prompt a suspend:
https://github.com/koreader/koreader...owerd.lua#L103
Code:
lipc-set-prop com.lab126.powerd powerButton 1
to simulate a power button press. this might speed up the suspend procces (not sure i never tested this.)
you can see my work here (in shell)
https://github.com/yparitcher/kindle...zman_backround
the project currently uses the lipc C interface
https://github.com/yparitcher/kindle-zmanim