From 33e0233b036b24aea52ade6455ac384bb8b37370 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Thu, 18 Jul 2024 17:15:35 -0400 Subject: [PATCH] hyprland/wallpaper: spawn new swyabg process before killing old one --- homeManagerModules/desktop/hyprland/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeManagerModules/desktop/hyprland/default.nix b/homeManagerModules/desktop/hyprland/default.nix index c0bfccf2..65b73568 100644 --- a/homeManagerModules/desktop/hyprland/default.nix +++ b/homeManagerModules/desktop/hyprland/default.nix @@ -81,9 +81,9 @@ in { # Update wallpapers after the set interval active_monitors.each do |monitor| if Time.now - last_update_time[monitor] >= update_interval - Process.kill('TERM', current_pids[monitor]) if current_pids[monitor] random_background = Dir.glob(File.join(directory, '*.{png,jpg}')).sample pid = spawn("${lib.getExe pkgs.swaybg}", '-o', monitor, '-i', random_background, '-m', 'fill') + Process.kill('TERM', current_pids[monitor]) if current_pids[monitor] current_pids[monitor] = pid last_update_time[monitor] = Time.now known_monitors[monitor] = random_background