mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-14 04:32:12 +00:00
Image: [Shuffle] Fixed issues with shuffle mode
This commit is contained in:
4
neofetch
4
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"
|
||||
|
||||
Reference in New Issue
Block a user