Often times the low battery notification can be ignored. It notifies around ~10% and then someone can go off and do other things. Usually in a zoom, the laptop can suddenly die taking seconds or even minutes to come back online.
Use a shell script on a cron to notify every minute it's charging. Depending on the rate of discharge, this can be 10 or more dings before the laptop is dead.
- Setup a directory
mkdir -p $HOME/scripts
- Download the battery.sh script
wget \ https://gist.githubusercontent.com/nitrocode/6a03f19b24c4bd7c2aa7fd34fc00c493/raw/battery.sh \ -O $HOME/scripts/battery.sh
- Set the script to execute
chmod +x $HOME/scripts/battery.sh
- Run the script as a test
$HOME/scripts/battery.sh
- Setup crontab
crontab -e
* * * * * /Users/user/scripts/battery.sh
Every time a cron
script runs echo
, it will show up as a new message in mail
. This is why the above echo
calls have been commented out.
Last login: Mon Oct 28 16:13:06 on ttys000
You have new mail.
Held 4024 messages in /var/mail/user
If they have been commnted in, remove the mail.
rm /var/mail/$USER