diff --git a/modules/home/hyprland/config.nix b/modules/home/hyprland/config.nix index f6dfded..7b64e55 100644 --- a/modules/home/hyprland/config.nix +++ b/modules/home/hyprland/config.nix @@ -4,6 +4,32 @@ lib, ... }: { + services.hypridle.settings = { + general = { + # lock_cmd = notify-send "lock!" # dbus/sysd lock command (loginctl lock-session) + # unlock_cmd = notify-send "unlock!" # same as above, but unlock + ignore_dbus_inhibit = "false"; # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam) + lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances. + before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. + }; + + listener = [ + # Screenlock + { + timeout = 180; # in seconds + on-timeout = "hyprlock"; # command to run when timeout has passed + # on-resume = notify-send "Welcome back to your desktop!" # command to run when activity is detected after timeout has fired. + } + # Suspend + { + timeout = 360; # in seconds + on-timeout = "systemctl suspend"; # command to run when timeout has passed + # on-resume = notify-send "Welcome back to your desktop!" # command to run when activity is detected after timeout has fired. + } + ]; + }; + programs.hyprlock = lib.mkIf config.wayland.windowManager.hyprland.enable { enable = true; settings = { diff --git a/modules/home/hyprland/hyprland.nix b/modules/home/hyprland/hyprland.nix index d806fe2..264f43e 100644 --- a/modules/home/hyprland/hyprland.nix +++ b/modules/home/hyprland/hyprland.nix @@ -9,6 +9,8 @@ wl-clipboard ]; + services.hypridle.enable = true; + programs.wpaperd = { enable = true; settings = {