This commit is contained in:
2025-11-03 02:51:16 +09:00
parent 70794c2bd0
commit 1a8b4f0a41
2 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
}; };
logind = { logind = {
lidSwitch = "lock"; # Lock when lid is closed lidSwitch = "suspend"; # Lock when lid is closed
lidSwitchDocked = "ignore"; # Ignore when docked lidSwitchDocked = "ignore"; # Ignore when docked
extraConfig = '' extraConfig = ''
HandleLidSwitchExternalPower=lock HandleLidSwitchExternalPower=lock
+3 -6
View File
@@ -7,7 +7,6 @@ let
lockCmd = "${noctaliaExe} ipc call sessionMenu lock"; lockCmd = "${noctaliaExe} ipc call sessionMenu lock";
lockAndSuspendCmd= "${noctaliaExe} ipc call sessionMenu lockAndSuspend"; lockAndSuspendCmd= "${noctaliaExe} ipc call sessionMenu lockAndSuspend";
dpmsOff = "${pkgs.niri}/bin/niri msg action power-off-monitors"; dpmsOff = "${pkgs.niri}/bin/niri msg action power-off-monitors";
dpmsOn = "${pkgs.niri}/bin/niri msg action power-on-monitors"; dpmsOn = "${pkgs.niri}/bin/niri msg action power-on-monitors";
in in
@@ -17,14 +16,12 @@ in
systemdTarget = "graphical-session.target"; systemdTarget = "graphical-session.target";
timeouts = [ timeouts = [
{ timeout = 300; command = noctaliaLock; } { timeout = 300; command = lockAndSuspendCmd; }
{ timeout = 306; command = dpmsOff; resumeCommand = dpmsOn; }
]; ];
events = [ events = [
{ event = "lock"; command = noctaliaLock; } { event = "lock"; command = lockCmd; }
{ event = "before-sleep"; command = noctaliaLock; } { event = "before-sleep"; command = lockCmd; }
{ event = "after-resume"; command = dpmsOn; } { event = "after-resume"; command = dpmsOn; }
]; ];
}; };