diff --git a/home/wm/addon/swayidle.nix b/home/wm/addon/swayidle.nix index fe0e2c3..da36fc4 100644 --- a/home/wm/addon/swayidle.nix +++ b/home/wm/addon/swayidle.nix @@ -1,17 +1,27 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +let + swaylock = "${pkgs.swaylock}/bin/swaylock"; + hyprctl = "${pkgs.hyprland}/bin/hyprctl"; +in +{ services.swayidle = { enable = true; systemdTarget = "graphical-session.target"; events = [ { event = "before-sleep"; - command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; + command = "${swaylock} -f -i /tmp/lockpaper.jpg"; } ]; timeouts = [ { timeout = 600; - command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; + command = "${swaylock} -f -i /tmp/lockpaper.jpg"; + } + { + timeout = 900; + command = "${hyprctl} dispatch dpms off"; + resumeCommand = "${hyprctl} dispatch dpms on"; } ]; };