From a4fec94cc70f5090bafce98c2986b32cb2a06d40 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 15 Jan 2017 09:44:56 +1100 Subject: [PATCH] Image: [Shuffle] Fixed issues with shuffle mode --- neofetch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index e8cb0cb5..c50d5542 100755 --- a/neofetch +++ b/neofetch @@ -2058,8 +2058,10 @@ get_image_source() { *) if [[ -d "$image_source" ]]; then + shopt -s nullglob files=("${image_source%/}"/*.{png,jpg,jpeg,jpe,gif}) - printf -v image "%s" "${files[RANDOM % (${#files[@]} - 1)]}" + shopt -u nullglob + image="${files[RANDOM % ${#files[@]}]}" else image="$image_source"