mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-24 04:22:32 +00:00
Swap shuf for a more universal alternative
This commit is contained in:
3
neofetch
3
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
|
||||
|
||||
Reference in New Issue
Block a user