From 27285b10c8b9cd90a945ef7167d4c6d93daf5e3e Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 12 May 2024 19:38:06 +0900 Subject: [PATCH] wallpaperRamdom will only change focused monitor --- config/hypr/UserScripts/WallpaperRandom.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index adaec3b..050c10c 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -5,6 +5,8 @@ wallDIR="$HOME/Pictures/wallpapers" scriptsDir="$HOME/.config/hypr/scripts" +focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') + PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} @@ -17,7 +19,7 @@ BEZIER=".43,1.19,1,.4" SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" -swww query || swww-daemon --format xrgb && swww img ${RANDOMPICS} $SWWW_PARAMS +swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS ${scriptsDir}/WallustSwww.sh