Skip to content

Using sxiv to open images #808

Answered by xezwary
krackout asked this question in Q&A
Apr 8, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Looks like Ranger uses a script that sends all files in the directory to sxiv
https://github.com/nsxiv/nsxiv-extra/tree/master/scripts/nsxiv-rifle

Here's the code I use in lfrc:

*.jpg|*.png|*.jpeg|*.JPG|*.JPEG|*.PNG|*.webp|*.ico|*.tga|*.gif)
    [[ $(echo "$fx"|wc -l) == 1 ]]&&imagelist=$(find . -maxdepth 1 -regextype posix-extended -iregex '.*(jpg|png|jpeg|webp|ico|tga|gif)'|sort -fV)&&for i in $imagelist;do echo $i;done|nsxiv -g 2560x1440 -s f -a -n $(echo "${imagelist[*]}"|grep --line-number --fixed-strings -- "./$(basename $f)"|cut -f1 -d:) -- -||for i in $fx;do echo $i;done|sort -fV|nsxiv -g 2560x1440 -s f -a -- - &
;;

Edit: Should probably add set ifs "\n" in lfrc

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@krackout
Comment options

@xezwary
Comment options

Answer selected by krackout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants