initial
This commit is contained in:
33
hosts/dunamis/users/user/desktop/river/swayidle.nix
Normal file
33
hosts/dunamis/users/user/desktop/river/swayidle.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
swayidle.enable =
|
||||
lib.mkEnableOption "enable swayidle";
|
||||
};
|
||||
config = lib.mkIf config.swayidle.enable {
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
systemdTarget = "graphical-session.target";
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 300;
|
||||
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
|
||||
}
|
||||
{
|
||||
timeout = 600;
|
||||
command = "${pkgs.niri}/bin/niri msg action power-off-monitors";
|
||||
}
|
||||
];
|
||||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user