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
|
||||
[[ -f "$file" ]] && images+=("$file")
|
||||
done
|
||||
images=($(printf "%s\n" "${images[@]}" | sort -V))
|
||||
for ((i=0; i<${#images[@]}; i++)); do
|
||||
[[ "${images[i]}" = "$selected_file" ]] && {
|
||||
setsid sxiv -aon "$((i + 1))" "${images[@]}"
|
||||
sorted_images=()
|
||||
while IFS= read -r line; do
|
||||
sorted_images+=("$line")
|
||||
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
|
||||
}
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user