{config, ...}: { services.swayidle = { enable = config.desktops.sway.enable; systemdTarget = "sway-session.target"; timeouts = [ { timeout = 300; command = "${config.default.lockScreen}"; } { timeout = 300; command = "swaymsg \"output * power off\""; resumeCommand = "swaymsg \"output * power on\""; } ]; events = [ { event = "before-sleep"; command = "${config.default.lockScreen}"; } ]; }; }