Bryan lets us know some neat functionality recently landed in systemd...
You mentioned trying out battery charge thresholds on your laptop using tlp (never remembering to use `tlp fullcharge`), This functionality was recently exposed by the kernel, so now you can do the same thing with a systemd service now.
Start the service when you want to enable the thresholds and stop it when you want the laptop to fully charge. Easy peasy and ready to automate or tie to a hotkey.
Cheers,
Bryan
Example unit file [does not need read on air]
# /etc/systemd/system/set-battery-charge-threshold.service
[Unit]
Description=Set battery charge thresholds
After=multi-user.target
StartLimitBurst=0
[Service]
Type=oneshot
Restart=on-failure
RemainAfterExit=yes
ExecStart=/bin/bash -c 'echo 80 > /sys/class/power_supply/BAT0/charge_control_start_threshold; echo 90 > /sys/class/power_supply/BAT0/charge_control_end_threshold'
ExecStop=/bin/bash -c 'echo 100 > /sys/class/power_supply/BAT0/charge_control_end_threshold; echo 99 > /sys/class/power_supply/BAT0/charge_control_start_threshold'
[Install]
WantedBy=multi-user.target