hyprland/wallpaper: spawn new swyabg process before killing old one
Some checks are pending
flakehub / flakehub-publish (push) Waiting to run
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run
nix-drybuild / fallarbor-drybuild (push) Waiting to run
nix-drybuild / lavaridge-drybuild (push) Waiting to run
nix-drybuild / mauville-drybuild (push) Waiting to run
nix-drybuild / petalburg-drybuild (push) Waiting to run
nix-drybuild / rustboro-drybuild (push) Waiting to run

This commit is contained in:
Aly Raffauf 2024-07-18 17:15:35 -04:00
parent d2e51f8a32
commit 33e0233b03

View file

@ -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