mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-26 16:34:34 +00:00
Fix power-profile auto-switch
This commit is contained in:
parent
a0bba2e225
commit
0a9742429d
|
@ -19,6 +19,7 @@ in {
|
||||||
systemd.services."power-monitor" = let
|
systemd.services."power-monitor" = let
|
||||||
dependencies = with pkgs; [
|
dependencies = with pkgs; [
|
||||||
coreutils
|
coreutils
|
||||||
|
gnugrep
|
||||||
power-profiles-daemon
|
power-profiles-daemon
|
||||||
inotify-tools
|
inotify-tools
|
||||||
jaq
|
jaq
|
||||||
|
|
|
@ -6,7 +6,7 @@ BAT_CAP="$BAT/capacity"
|
||||||
|
|
||||||
POWER_SAVE_PERCENT=50 # Enter power-save mode if on bat and below this 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
|
# monitor loop
|
||||||
prev=0
|
prev=0
|
||||||
|
|
Loading…
Reference in a new issue