Created
October 26, 2022 00:23
-
-
Save abderraouf-adjal/1e47af1018cf51f99023a9d72194ed3a to your computer and use it in GitHub Desktop.
ThinkPad T15 G2 battery threshold limits systemd script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Set the battery charge threshold | |
After=multi-user.target | |
StartLimitBurst=0 | |
[Service] | |
Type=oneshot | |
Restart=on-failure | |
ExecStartPre=/bin/sleep 10 | |
ExecStart=/bin/bash -c 'echo 50 > /sys/class/power_supply/BAT0/charge_control_end_threshold && echo 45 > /sys/class/power_supply/BAT0/charge_control_start_threshold' | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment