This commit is contained in:
2025-11-03 02:08:47 +09:00
parent bc8a6a8f3f
commit c24198b171
4 changed files with 38 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
{ pkgs, lib, ... }:
let
noctaliaLock = "qs -c noctalia-shell 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
{
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
timeouts = [
{ timeout = 300; command = noctaliaLock; }
{ timeout = 306; command = dpmsOff; resumeCommand = dpmsOn; }
];
events = [
{ event = "lock"; command = noctaliaLock; }
{ event = "before-sleep"; command = noctaliaLock; }
{ event = "after-resume"; command = dpmsOn; }
];
};
}