feat(wm): add and enable swayidle

This commit is contained in:
etwas 2025-12-02 19:25:07 +01:00
parent aa853d6703
commit 8ef74f0d75
2 changed files with 17 additions and 0 deletions

View file

@ -8,6 +8,7 @@
./hyprpaper.nix
./niri
./rofi
./swayidle.nix
./swaylock.nix
./waybar
./xdg.nix

16
home/wm/swayidle.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }: {
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
events = [
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
];
timeouts = [
{ timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
{ timeout = 301; command = "${pkgs.niri}/bin/niri msg action power-off-monitors && ${pkgs.systemd}/bin/systemctl hibernate"; }
];
};
}