From 4ead66e6b13a10ad3bb23d85d29f741cf10c542c Mon Sep 17 00:00:00 2001 From: Myned Date: Thu, 26 Dec 2024 00:29:16 -0500 Subject: [PATCH] hypridle: fix red background when locking Signed-off-by: Myned --- options/custom/services/hypridle.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/options/custom/services/hypridle.nix b/options/custom/services/hypridle.nix index 2b288d0..e62b794 100644 --- a/options/custom/services/hypridle.nix +++ b/options/custom/services/hypridle.nix @@ -24,10 +24,20 @@ in { services.hypridle = { enable = true; - settings = { - general = { - before_sleep_cmd = "${pgrep} hyprlock || ${hyprlock} --immediate"; - lock_cmd = "${pgrep} hyprlock || ${hyprlock}"; + settings = let + # Workaround for red background immediately showing while lockscreen starts + # https://github.com/YaLTeR/niri/issues/808 + do-screen-transition = "${niri} msg action do-screen-transition --delay-ms 1000 &&"; + in { + general = let + lock = "${pgrep} hyprlock || ${ + if config.custom.desktops.desktop == "niri" + then do-screen-transition + else "" + } ${hyprlock}"; + in { + before_sleep_cmd = "${lock} --immediate"; + lock_cmd = lock; }; listener = [