Skip to content

Instantly share code, notes, and snippets.

@MeganerdNL
Last active September 14, 2026 18:36
Show Gist options
  • Select an option

  • Save MeganerdNL/542e9fdbbd90a9d9d87bf6dc4a6144c2 to your computer and use it in GitHub Desktop.

Select an option

Save MeganerdNL/542e9fdbbd90a9d9d87bf6dc4a6144c2 to your computer and use it in GitHub Desktop.
Oneshot systemd service file for the Framework 16 laptop to set battery charge limit
## Oneshot systemd service file for the Framework 16 laptop to set batery charge limit
## Defaults here is to stop charging at 80%. Customize as needed
## The framework 16 laptop does NOT support a start threshold (charge_control_start_threshold) atm (sept 2026)
## Place in: /etc/systemd/system/battery-charge-limit.service
## Reload after making: sudo systemctl daemon-reload
## Enable and start: sudo systemctl enable --now battery-charge-limit.service
[Unit]
Description=Set battery charge limit
ConditionPathExists=/sys/class/power_supply/BAT1/charge_control_end_threshold
[Service]
Type=oneshot
ExecStart=/bin/bash -c "echo 80 > /sys/class/power_supply/BAT1/charge_control_end_threshold"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment