Lithium batteries wear more quickly when fully charged but of course you need the capacity on the move. Here's a solution: When at home, charge to 85% and 100% when not connected to your home network (wired or wireless).
Pre-requirements: Linux, NetworkManager
Place the following file under /etc/NetworkManager/dispatcher.d
.
Edit the network name list on line 7 to match your needs. Examples are
Foonet and Barnet. See possible network names by running:
nmcli -t -f name connection show
Also, double-check the sysfs path to your battery. In most cases it's /sys/class/power_supply/BAT0/
.
Finally, make sure file is executable and owned by root (chmod +x
and chown root:root
).