mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Fix sorting with spaces
This commit is contained in:
parent
dfeb8e2ecd
commit
224ae5b406
@ -42,10 +42,13 @@ cmd open ${{
|
|||||||
for file in "$dir"/*.{jpg,jpeg,png,webp,bmp,tiff,tif,raw,ico,exif,heic,heif,gif,avif,jxl,JPG,PNG}; do
|
for file in "$dir"/*.{jpg,jpeg,png,webp,bmp,tiff,tif,raw,ico,exif,heic,heif,gif,avif,jxl,JPG,PNG}; do
|
||||||
[[ -f "$file" ]] && images+=("$file")
|
[[ -f "$file" ]] && images+=("$file")
|
||||||
done
|
done
|
||||||
images=($(printf "%s\n" "${images[@]}" | sort -V))
|
sorted_images=()
|
||||||
for ((i=0; i<${#images[@]}; i++)); do
|
while IFS= read -r line; do
|
||||||
[[ "${images[i]}" = "$selected_file" ]] && {
|
sorted_images+=("$line")
|
||||||
setsid sxiv -aon "$((i + 1))" "${images[@]}"
|
done < <(printf "%s\n" "${images[@]}" | sort -V)
|
||||||
|
for ((i=0; i<${#sorted_images[@]}; i++)); do
|
||||||
|
[[ "${sorted_images[i]}" = "$selected_file" ]] && {
|
||||||
|
setsid sxiv -aon "$((i + 1))" "${sorted_images[@]}"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user