{ config, lib, ... }: let cfg = config.wayland.windowManager.hyprland; in { config.services.hypridle = lib.mkIf cfg.enable { enable = true; settings = { general = { lock_cmd = "loginctl lock-session"; # before_sleep_cmd = "loginctl lock-session"; after_sleep_cmd = "hyprctl dispatch dpms on"; inhibit_sleep = 3; }; listener = [ { timeout = 420; on-timeout = "loginctl lock-session"; } { timeout = 600; on-timeout = "hyprctl dispatch dpms off"; on-resume = "hyprctl dispatch dpms on"; } { timeout = 900; on-timeout = "systemctl resume"; } ]; }; }; }