diff --git a/.config/lf/lfrc b/.config/lf/lfrc index f43fae6d..2a626687 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -34,6 +34,10 @@ cmd open ${{ text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; + image/*) bash -c ' + shopt -s nullglob + dir="$0" + selected_file="$1" image/*) bash -c ' shopt -s nullglob dir="$0" @@ -44,8 +48,7 @@ cmd open ${{ done for ((i=0; i<${#images[@]}; i++)); do [[ "${images[i]}" = "$selected_file" ]] && { - images=( "${images[@]:i}" "${images[@]:0:i}" ) - sxiv -abfio "${images[@]}" + sxiv -nabfio "$((i + 1))" "${images[@]}" break } done