Skip to content

Commit

Permalink
Add pausePlayersOnSuspend option to powerdevil module (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN authored Sep 22, 2024
1 parent 353abd9 commit 8b06b3e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion modules/powerdevil.nix
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,27 @@ in
AC = (createPowerDevilOptions "AC");
battery = (createPowerDevilOptions "battery");
lowBattery = (createPowerDevilOptions "lowBattery");
general = {
pausePlayersOnSuspend = lib.mkOption {
type = with lib.types; nullOr bool;
default = null;
example = false;
description = ''
If enabled, pause media players when the system is suspended.
'';
};
};
};
};

config.programs.plasma.configFile = lib.mkIf cfg.enable {
powerdevilrc = lib.filterAttrsRecursive (k: v: v != null) ((createPowerDevilConfig "AC" "AC")
// (createPowerDevilConfig "Battery" "battery")
// (createPowerDevilConfig "LowBattery" "lowBattery"));
// (createPowerDevilConfig "LowBattery" "lowBattery")
// {
General = {
pausePlayersOnSuspend = cfg.powerdevil.general.pausePlayersOnSuspend;
};
});
};
}

0 comments on commit 8b06b3e

Please sign in to comment.