pascalw / kindle-dash

Power efficient dashboard for Kindle 4 NT devices
MIT License
1.21k stars 34 forks source link

Changing low-battery.sh to turn off the kindle and then ensure dash.sh/start.sh runs on boot #21

Open floftus-at-csm opened 1 year ago

floftus-at-csm commented 1 year ago

Currently if my Kindle loses power while running the script it will go to the standard "Kindle Out Of Power - Please Recharge Now" screen. Then when I recharge the Kindle, it does not turn on and automatically run this script. Instead it goes back to standard 'book mode' (hopefully this makes sense!)

The functionality I would like in low-battery.sh is:

  1. a message appears when the battery is low (this seems ok following this advice https://github.com/pascalw/kindle-dash/issues/13)
  2. if battery is very low, the kindle powers down, leaving the image currently on the screen in place (can I just use sudo shutdown -h now in low-battery.sh inside a conditional with a threshold of, say 5?)
  3. dash.sh/start.sh runs at startup (can I use standard linux commands such as crontab? if so I would just run /mnt/us/dashboard/start.sh at reboot - based on this thread it seems that crontab works on the Kindle 3 so hopefully 4 as well https://www.mobileread.com/forums/showthread.php?t=156472)

As I've written this I feel I've answered some of my own questions but I'll leave this here as I'm interested to know if this sounds like the best approach and what the right way of turning off the kindle is

Thanks!