~mlaparie/charge-control

A Bash script to automatically limit charge within healthy battery levels
Fix interval message
Add batlog script to monitor battery and CPU use
Adjust spinner speeds

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~mlaparie/charge-control
read/write
git@git.sr.ht:~mlaparie/charge-control

You can also use your local clone with git send-email.

charge-control allows controlling battery charge to avoid overstressing the battery with full charges or full discharges. The script requires root permissions.

#How to use

Just download the script and make it executable with chmod +x /path/to/charge-control, then run it with sudo:

Usage: sudo ./charge-control [-d DEACTIVATION] [-r REACTIVATION] [-f FREQUENCY] [-p POWEROFF] [-a ANIMATION]

Options:
  -d DEACTIVATION: battery percentage at which charge is disabled (default: 90)
  -r REACTIVATION: battery percentage at which charge is enabled (default: 75)
  -f FREQUENCY: monitoring frequency of battery level (default: 10s)
  -p POWEROFF: battery percentage at which the device is powered off (default: 10)
  -a ANIMATION: monitoring animation, 1, 2, 3 or 4, in decreasing CPU usage order (default: 2)
  -h: show this help

All arguments are optional. Values can be provided as positional arguments in that order
if not prefixed with flags, or provided in any order if prefixed with flags.

#Example output

● Charge control enabled
  Charge deactivation level: 90%
  Charge reactivation level: 75%
  Monitoring frequency: 10
  Auto power-off level: 10%
  ▪ Charge enabled until battery reaches 90% (20:29)
  ▪ Charge disabled until battery drops to 75% (21:02)  
  ⣷ Monitoring battery level...
Do not follow this link