Suspend when the battery is low

This commit is contained in:
coolneng 2021-02-17 03:50:33 +01:00
parent 28e16734d0
commit cbf0038c6f
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 4 additions and 7 deletions

View File

@ -37,11 +37,8 @@
};
};
# Suspend to RAM/disk when battery is critical
services.upower = {
enable = true;
percentageLow = 15;
percentageCritical = 10;
percentageAction = 7;
};
# Suspend when the battery is critical
services.udev.extraRules = ''
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{model_name}=="01AV405", ATTR{capacity}=="[0-5]", RUN+="${config.systemd.package}/bin/systemctl suspend -i"
'';
}