Simplified image shuffle, thanks @aranega

This commit is contained in:
Dylan Araps 2016-06-10 19:46:00 +10:00
parent 0527469643
commit 067c200b71

View file

@ -2264,8 +2264,8 @@ getimage () {
"wall") getwallpaper ;; "wall") getwallpaper ;;
"ascii") getascii; return ;; "ascii") getascii; return ;;
*) *)
if [ "${image: -1}" == "/" ]; then if [ -d "$image" ]; then
files=("$image"*.png "$image"*.jpg) files=("$image"*.{png,jpg,jpeg})
img="$(printf "%s" "${files[RANDOM % (${#files[@]} - 1)]}")" img="$(printf "%s" "${files[RANDOM % (${#files[@]} - 1)]}")"
else else
img="$image" img="$image"