This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.linux/systemd/power/powerlimit.service

13 lines
531 B
Desktop File

[Unit]
Description=limit battery charge to 40-80 percent
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/usr/bin/bash -c '/usr/bin/echo 40 > /sys/class/power_supply/BAT0/charge_control_start_threshold; /usr/bin/echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold;'
ExecStop=/usr/bin/bash -c '/usr/bin/echo 95 > /sys/class/power_supply/BAT0/charge_control_end_threshold; /usr/bin/echo 90 > /sys/class/power_supply/BAT0/charge_control_start_threshold;'
#Restart=on-failure
[Install]
WantedBy=multi-user.target