From 1a8b4f0a4165445265d772ea94cd4aaa9c0c45e9 Mon Sep 17 00:00:00 2001 From: moons-14 Date: Mon, 3 Nov 2025 02:51:16 +0900 Subject: [PATCH] fix --- modules/core/services.nix | 2 +- modules/home/lock.nix | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/core/services.nix b/modules/core/services.nix index 6d21b52..e956ee3 100644 --- a/modules/core/services.nix +++ b/modules/core/services.nix @@ -18,7 +18,7 @@ }; logind = { - lidSwitch = "lock"; # Lock when lid is closed + lidSwitch = "suspend"; # Lock when lid is closed lidSwitchDocked = "ignore"; # Ignore when docked extraConfig = '' HandleLidSwitchExternalPower=lock diff --git a/modules/home/lock.nix b/modules/home/lock.nix index c2a6c9b..52a26c4 100644 --- a/modules/home/lock.nix +++ b/modules/home/lock.nix @@ -7,7 +7,6 @@ let lockCmd = "${noctaliaExe} ipc call sessionMenu lock"; lockAndSuspendCmd= "${noctaliaExe} ipc call sessionMenu lockAndSuspend"; - dpmsOff = "${pkgs.niri}/bin/niri msg action power-off-monitors"; dpmsOn = "${pkgs.niri}/bin/niri msg action power-on-monitors"; in @@ -17,14 +16,12 @@ in systemdTarget = "graphical-session.target"; timeouts = [ - { timeout = 300; command = noctaliaLock; } - - { timeout = 306; command = dpmsOff; resumeCommand = dpmsOn; } + { timeout = 300; command = lockAndSuspendCmd; } ]; events = [ - { event = "lock"; command = noctaliaLock; } - { event = "before-sleep"; command = noctaliaLock; } + { event = "lock"; command = lockCmd; } + { event = "before-sleep"; command = lockCmd; } { event = "after-resume"; command = dpmsOn; } ]; };