diff --git a/modules/desktop/hypridle.nix b/modules/desktop/hypridle.nix index b3ebbbd..231dd50 100644 --- a/modules/desktop/hypridle.nix +++ b/modules/desktop/hypridle.nix @@ -14,16 +14,18 @@ in { }; config = mkIf cfg.enable { - hm.services.hypridle = { + hm.services.hypridle = let + hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl"; + in { enable = true; package = cfg.package; - lockCmd = "${pkgs.procps}/bin/pidof hyprlock || ${config.modules.desktop.hyprland.package}/bin/hyprctl dispatch exec ${lib.getExe config.modules.desktop.hyprlock.package}"; + lockCmd = "${pkgs.procps}/bin/pidof hyprlock || ${hyprctl} dispatch exec ${lib.getExe config.modules.desktop.hyprlock.package}"; unlockCmd = "${pkgs.procps}/bin/pkill -USR1 hyprlock"; - listeners = let - hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl"; - in [ + beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session"; + + listeners = [ { timeout = 90; # 1.5 min onTimeout = "${hyprctl} dispatch dpms off"; # turn off screen @@ -31,11 +33,11 @@ in { } { timeout = 60 * 2; # 2 min - onTimeout = "loginctl lock-session"; # lock computer + onTimeout = "${pkgs.systemd}/bin/loginctl lock-session"; # lock computer } { timeout = 60 * 30; # 30 min - onTimeout = "systemctl suspend"; # sleep/suspend + onTimeout = "${pkgs.systemd}/bin/systemctl suspend"; # sleep/suspend } ]; }; diff --git a/modules/desktop/hyprlock.nix b/modules/desktop/hyprlock.nix index c9ded89..921aeae 100644 --- a/modules/desktop/hyprlock.nix +++ b/modules/desktop/hyprlock.nix @@ -15,17 +15,16 @@ in { config = mkIf cfg.enable { security.pam.services.hyprlock.text = "auth include login"; - powerManagement.resumeCommands = '' - ${pkgs.procps}/bin/pidof hyprlock || ${lib.getExe cfg.package} - ''; hm.programs.hyprlock = with config.colorScheme.palette; { enable = true; package = cfg.package; + general = { hide_cursor = false; no_fade_in = true; no_fade_out = true; }; + backgrounds = [ { path = toString ../../assets/lockscreen.png; @@ -33,6 +32,7 @@ in { blur_size = 6; } ]; + labels = [ { text = "cmd[update:1000] echo \"$(date +'%H:%M')\""; @@ -49,6 +49,7 @@ in { position = { x = 0; y = 10; }; } ]; + input-fields = [ { size = { width = 300; height = 28; };