services.set_battery_threshold: dont run without battery

This commit is contained in:
Daniella / Tove 2024-10-20 11:00:11 +02:00
parent dcae161f30
commit f9aa497de8

View file

@ -108,7 +108,8 @@ in
systemd.services.set_battery_threshold = {
enable = true;
script = ''
echo 90 | tee /sys/class/power_supply/BAT*/charge_control_end_threshold > /dev/null
ls /sys/class/power_supply/BAT* || exit 0
echo 90 | tee /sys/class/power_supply/BAT*/charge_control_end_threshold > /dev/null
'';
wantedBy = ["multi-user.target"];
serviceConfig = {