From 2ae9f5ae43b7a2a73868432bea6655af1b187fbc Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Sun, 1 Dec 2024 13:37:04 +0100 Subject: [PATCH] Added small timeout after locking --- nixos/hyprland/hypridle.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/hyprland/hypridle.nix b/nixos/hyprland/hypridle.nix index 09002f8..32c318b 100644 --- a/nixos/hyprland/hypridle.nix +++ b/nixos/hyprland/hypridle.nix @@ -5,7 +5,6 @@ suspendScript = pkgs.writeShellScript "suspend-script" '' ${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q # only suspend if nothing is playing if [ $? == 1 ]; then - #loginctl lock-session ${pkgs.systemd}/bin/systemctl suspend fi ''; @@ -18,7 +17,7 @@ services.hypridle = { general = { lock_cmd="pidof hyprlock || hyprlock"; - before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + before_sleep_cmd = "loginctl lock-session && sleep 3s"; # lock before suspend. after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. ignore_dbus_inhibit = false; };