wallp dir fix

master
Daniel Napora 2024-09-19 22:56:38 +02:00
parent eb8b58be74
commit b2cea76745
1 changed files with 6 additions and 2 deletions

View File

@ -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[@]}"