From 5e0b3a3d0ea6236daed0463bc3f85f1b0947fb87 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 20 Apr 2024 09:58:36 -0400 Subject: [PATCH] hyprpaper: add dynamic multimonitor support --- .../desktop/hypr/hyprpaper/hyprpaper-random.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeManagerModules/desktop/hypr/hyprpaper/hyprpaper-random.nix b/homeManagerModules/desktop/hypr/hyprpaper/hyprpaper-random.nix index 7eb809cc..876e85b8 100644 --- a/homeManagerModules/desktop/hypr/hyprpaper/hyprpaper-random.nix +++ b/homeManagerModules/desktop/hypr/hyprpaper/hyprpaper-random.nix @@ -6,12 +6,12 @@ }: let hyprpaper-random = pkgs.writeShellScriptBin "hyprpaper-random" '' directory=${config.home.homeDirectory}/.local/share/backgrounds - monitor=`hyprctl monitors | grep Monitor | awk '{print $2}'` - + if [ -d "$directory" ]; then while true; do sleep 30 hyprctl hyprpaper unload all + monitor=`hyprctl monitors | grep Monitor | awk '{print $2}'` for m in ''${monitor[@]}; do random_background=$(ls $directory/*.{png,jpg} | shuf -n 1) hyprctl hyprpaper preload $random_background