Skip to content

Commit

Permalink
Add InhibitLidActionWhenExternalMonitorPresent option to powerdevil m…
Browse files Browse the repository at this point in the history
…odule (#361)
  • Loading branch information
HeitorAugustoLN authored Sep 9, 2024
1 parent ab213b4 commit 1babfbe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/powerdevil.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ let
'';
apply = action: if (action == null) then null else whenLaptopLidClosedActions."${action}";
};
inhibitLidActionWhenExternalMonitorConnected = lib.mkOption {
type = with lib.types; nullOr bool;
default = null;
example = true;
description = ''
If enabled, the lid action will be inhibited when an external monitor is connected.
'';
};
turnOffDisplay = {
idleTimeout = lib.mkOption {
type = with lib.types; nullOr (either (enum [ "never" ]) (ints.between 30 600000));
Expand Down Expand Up @@ -144,6 +152,7 @@ let
AutoSuspendIdleTimeoutSec = cfg.powerdevil.${optionsName}.autoSuspend.idleTimeout;
SleepMode = cfg.powerdevil.${optionsName}.whenSleepingEnter;
LidAction = cfg.powerdevil.${optionsName}.whenLaptopLidClosed;
InhibitLidActionWhenExternalMonitorPresent = cfg.powerdevil.${optionsName}.inhibitLidActionWhenExternalMonitorConnected;
};
"${cfgSectName}/Display" = {
TurnOffDisplayIdleTimeoutSec = cfg.powerdevil.${optionsName}.turnOffDisplay.idleTimeout;
Expand Down

0 comments on commit 1babfbe

Please sign in to comment.