mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 08:08:11 +09:00
lock
This commit is contained in:
@@ -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; }
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user