From b2cea76745cb75c2d9d197e7cf266146d8eaa5e3 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Thu, 19 Sep 2024 22:56:38 +0200 Subject: [PATCH] wallp dir fix --- usr/bin/jgwallpaperchanger | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr/bin/jgwallpaperchanger b/usr/bin/jgwallpaperchanger index 6c098c1..679ada1 100755 --- a/usr/bin/jgwallpaperchanger +++ b/usr/bin/jgwallpaperchanger @@ -181,8 +181,12 @@ if ! pgrep -f "mbwallpaper -s" > /dev/null; then readarray -t wpdirs < <(grep -v '^\s*$\|^#\|^\s*\#' "$CNF_FILE") [[ -d "$(xdg-user-dir PICTURES)/imagick" ]] && wallp=$(shopt -s nullglob ; set -- $(xdg-user-dir PICTURES)/imagick/*.{jpg,JPG,jpeg,JPEG,png,PNG,avif} ; echo $#) - [[ "$wallp" -gt "1" ]] && wpdirs=("$(xdg-user-dir PICTURES)/imagick" "${wpdirs[@]}") - + if [[ "$wallp" -gt "1" ]];then + imagickdir="$(xdg-user-dir PICTURES)/imagick" + imagickdir=${imagickdir/$HOME/\~} + wpdirs=("$imagickdir" "${wpdirs[@]}") + fi + wpdirs=("/usr/share/backgrounds/" "${wpdirs[@]}") #notify-send.sh "DIRS" "${#wpdirs[@]}"