Hi xaizek,
I'm currently attempting to add the command above to filextype, so when I open sxiv automatically by selecting the file in Vifm, I can mark the file and the selection is reflected in Vifm.
However I'm strugling with the following points:
- The command in the answer above works from the Vifm commandline, however I cannot get it to work from the filextype in vifmrc
-Ideally I would like to combine it with the script to scroll through all images availabe at this forum in https://q2a.vifm.info/431/sxiv-scroll-through-all-images?show=431#q431
What I have done so far is the following:
- Modified the original script to scroll through all images because I couldn't get it to work
- Added the options to return the files marked as a list in sxiv
- The script is working as expected when ran from bash, opens sxiv at the selected file, and scrolls through the files in the correct order, and returns the list of files marked. I also observed that the sorting of the files in Vifm and bash ls differs when the file names have spaces, so in that case the order is slightly diferent, as sxiv takes the file order from bash in the modified script.
The main issue im strugling with is passing the output list to the select command in filextype in vifmrc.
Please find the code samples for the modified bash script and excerpt from vifmrc bellow:
#!/bin/bash
shopt -s nullglob
file=$(basename -- "$1")
dir=$(dirname -- "$1")
arr=()
shift
cd -- "$dir"
for i in *; do
[[ -f "$i" ]] || continue
arr+=("$i")
[[ "$i" == "$file" ]] && n=${#arr[@]}
done
exec sxiv -n "$n" -oq "$dir"
Variant 1
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,
\ {View in feh}
\:select! play_images %c %i &,
Variant 2
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,
\ {View in feh}
\ play_images %c %i \| :select &,
Both variants are not working as expected in Vifm, they open sxiv, scroll in the correct order, but don't return the selection.
Could you please advise on how to get this functionallity.
Regards and thanks.