For limiting a MacBook battery's charge to prolong its life I find bclm
a lot more straightforward than AlDente.
sudo bclm write 81
keeps the hardware battery percentage at 80% on both my MacBooks (I haven't found a reason to use persist
, yet).
I would often set the bclm to 100 some period of time before taking one to a coffee shop. With this script I don't have to remember to reset it.
I currently combine it with telling DropBox to quit, which seems to smooth out issues with the machine orienting itself to the coffee shop's WiFi open waking up.
#!/bin/bash
echo "starting full charge cycle.."
sudo bclm-cc || exit 1
echo "telling dropbox to quit.."
osascript -e 'tell application "Dropbox" to quit'
echo "undock!, undock!"
Thanks to a tip from this very informative gist, I now have passwordless sudo set up.
sudo visudo
..opens /etc/sudoers
in vim. I added this to the bottom:
[my username] ALL=(ALL) NOPASSWD: /usr/local/bin/bclm
Now sudo bclm
no longer requires a password.