Skip to content

Instantly share code, notes, and snippets.

@RealYukiSan
Created August 8, 2024 01:41
Show Gist options
  • Save RealYukiSan/dd136ffe258dd1765718cb8da9812b6a to your computer and use it in GitHub Desktop.
Save RealYukiSan/dd136ffe258dd1765718cb8da9812b6a to your computer and use it in GitHub Desktop.
[systemd service] add a battery's threshold on supported laptop
# put the file on /etc/systemd/system
[Unit]
Description=Set Battery Threshold
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo 80 > /sys/class/power_supply/BAT1/charge_control_end_threshold'
RemainAfterExit=true
[Install]
WantedBy=multi-user.target hibernate.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment