Skip to content

Instantly share code, notes, and snippets.

@publicarray
Created April 26, 2021 21:29
Show Gist options
  • Save publicarray/0a069f461abbe9ef7ec8e6ff02eb46de to your computer and use it in GitHub Desktop.
Save publicarray/0a069f461abbe9ef7ec8e6ff02eb46de to your computer and use it in GitHub Desktop.
Limit battery charge - /etc/systemd/system/battery-charge-threshold.service
[Unit]
Description=Set the battery charge threshold
After=multi-user.target
StartLimitBurst=0
[Service]
Type=oneshot
Restart=on-failure
ExecStart=/bin/bash -c 'echo 70 > /sys/class/power_supply/BAT0/charge_control_end_threshold'
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment