From b829a1a5e5e4bbcd582d90ab98b7f4628857b35f Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 26 Mar 2016 09:10:20 +1100 Subject: [PATCH] Swap shuf for a more universal alternative --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index cb5046b8..f9077387 100755 --- a/neofetch +++ b/neofetch @@ -1923,7 +1923,8 @@ getimage () { "ascii") getascii; return ;; *) if [ "${image: -1}" == "/" ]; then - img="$(find "$image" -type f \( -name '*.jpg' -o -name '*.png' \) -print0 | shuf -n1 -z)" + files=("$image"*.png "$image"*.jpg) + img="$(printf "%s" "${files[RANDOM % ${#files[@]}]}")" else img="$image" fi