Fix power-profile auto-switch

This commit is contained in:
ItsDrike 2024-04-14 01:12:48 +02:00
parent a0bba2e225
commit 0a9742429d
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
2 changed files with 2 additions and 1 deletions

View file

@ -19,6 +19,7 @@ in {
systemd.services."power-monitor" = let
dependencies = with pkgs; [
coreutils
gnugrep
power-profiles-daemon
inotify-tools
jaq

View file

@ -6,7 +6,7 @@ BAT_CAP="$BAT/capacity"
POWER_SAVE_PERCENT=50 # Enter power-save mode if on bat and below this capacity
HAS_PERFORMANCE="$(powerprofilesctl list | grep performance)"
HAS_PERFORMANCE="$(powerprofilesctl list | grep "performance" || true)" # the || true ignores grep failing with non-zero code
# monitor loop
prev=0