From 265756abaf5d951844d368c2a112563d8d2e3a22 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Thu, 18 Jul 2024 17:53:19 -0400 Subject: [PATCH] hyprland/wallpaper: sleep before killing old swaybg instance --- homeManagerModules/desktop/hyprland/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/homeManagerModules/desktop/hyprland/default.nix b/homeManagerModules/desktop/hyprland/default.nix index 65b73568..3e99f69a 100644 --- a/homeManagerModules/desktop/hyprland/default.nix +++ b/homeManagerModules/desktop/hyprland/default.nix @@ -83,6 +83,7 @@ in { if Time.now - last_update_time[monitor] >= update_interval random_background = Dir.glob(File.join(directory, '*.{png,jpg}')).sample pid = spawn("${lib.getExe pkgs.swaybg}", '-o', monitor, '-i', random_background, '-m', 'fill') + sleep 1 Process.kill('TERM', current_pids[monitor]) if current_pids[monitor] current_pids[monitor] = pid last_update_time[monitor] = Time.now