13 lines
531 B
SYSTEMD
13 lines
531 B
SYSTEMD
|
[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
|