It's a simple shell script that can do two things:
- Report the current battery charge and whether the battery is charging or not.
- Shutdown the machine if the charge is below 5%, the battery is discharging, and the user is privileged to do so.
Currently I'm including this in a cron file. This repository should soon host a systemd timer file as well.
[ ] systemd timer file
[ ] use [/var]/run instead of /tmp for the "are we rebooting"-file
[ ] -h parameter and maybe even a manpage
More seriously: I really don't care enough for now since I am only using this privately and for now am NOT using the other stuff. Maybe if they drop www, they make me reconsider ;)
Because I can :) There are other mechanisms out there, but I started this script in unintended ignorance of these and now I finished it ;)