I have a project to control the battery but at the end of the day I needed something that just works. As I'm using auto-cpufreq I removed the TLP and therefore needed this battery limiter. Help planet and your pocket by preserving your laptop battery life.
Create systemd service file (/etc/systemd/system/battery-threshold.service
) to run as root:
sudo nano /etc/systemd/system/battery-threshold.service
[Unit]
Description=Set Battery Charge Limit
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo 53 > /sys/class/power_supply/BAT1/charge_control_end_threshold'
User=root
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable battery-threshold.service
sudo systemctl start battery-threshold.service
(I knew what I wanted and gpt did the rest.)