diff options
Diffstat (limited to 'config/hypr/UserScripts/WallpaperAutoChange.sh')
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperAutoChange.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh index faec6335..5cee2a1e 100755 --- a/config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -13,13 +13,11 @@ # NOTE: this script uses bash (not POSIX shell) for the RANDOM variable wallust_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh +SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') -if command -v awww >/dev/null 2>&1; then - WWW="awww" -else - WWW="swww" -fi if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then echo "Usage: @@ -41,12 +39,13 @@ while true; do done \ | sort -n | cut -d':' -f2- \ | while read -r img; do - $WWW img -o $focused_monitor "$img" + resize_mode="$(wallpaper_resize_mode "$img" "$focused_monitor")" + "$WWW_CMD" img -o "$focused_monitor" --resize "$resize_mode" "$img" # Regenerate colors from the exact image path to avoid cache races $HOME/.config/hypr/scripts/WallustSwww.sh "$img" # Refresh UI components that depend on wallust output $wallust_refresh sleep $INTERVAL - + done done |
