if [ ! -d "$HOME/Pictures/Wall" ]; then exit 1 fi while IFS= read -r file; do # Add space between filenames if string is not empty if [ -n "$files_string" ]; then files_string+=" " fi files_string+="$file" done < <(find "$HOME/Pictures/Wall" -type f) echo $files_string feh --bg-fill $files_string compton &