02-04-2022, 05:29 AM
I wrote a low-power-off BASH script for the Pinephone and Pinephone Pro to help prevent over-discharge by forcing a power-off below a certain capacity.
It loops through all power sources the kernel is aware of and enforces a minimum capacity rule that powers off the system if a battery is below a certain threshold (default: 5%) and not charging.
It just needs something to run it every minute. I've included a Systemd setup guide but OpenRC (PostmarketOS), chron, ect will work just as well.
Guide here: https://discourse.destinationlinux.netwo...ttery/4789
Enjoy
It loops through all power sources the kernel is aware of and enforces a minimum capacity rule that powers off the system if a battery is below a certain threshold (default: 5%) and not charging.
It just needs something to run it every minute. I've included a Systemd setup guide but OpenRC (PostmarketOS), chron, ect will work just as well.
Guide here: https://discourse.destinationlinux.netwo...ttery/4789
Enjoy