[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