sxiv-flexipatch icon indicating copy to clipboard operation
sxiv-flexipatch copied to clipboard

Could you add that all images from a directory are loaded?

Open fov95 opened this issue 3 years ago • 9 comments

Someone patched his Sxiv so if you open a picture it automatically loads in all other pictures in the given directory so one can scroll through.. I know there is hacky stuff but this would be a nice addition to flexipatch imho.. https://github.com/qsmodo/sxiv

edit: I might be to stupid to get it to work right.. I know there is an -F option but I have to give it a list.. like -F file filelist.. then it works.. but it's hard to integrate into my filemanager..

One could do something like sxiv file "$(pwd)" but then u have a duplicate. I'd rather have an internal function..

fov95 avatar Feb 09 '22 19:02 fov95

IMO, this is better done via a script like sxiv-rifle.

Also there's a couple hacky things going on with that patch such as looping through the entire filelist for every single file. And then looping through it again to find the initial file.

https://github.com/qsmodo/sxiv/blob/7888d0017b3eb60e38dca5bb2c13d75f15d1ab14/main.c#L130-L134 https://github.com/qsmodo/sxiv/blob/7888d0017b3eb60e38dca5bb2c13d75f15d1ab14/main.c#L931-L936

On my system, this ends up being noticeably slower than the sxiv-rifle script (run via dash) when opening large directories.

N-R-K avatar Mar 12 '22 08:03 N-R-K

Anyhow, you can probably use this (append .patch to the url to download the patch) if you really want a native patch.

N-R-K avatar Mar 14 '22 10:03 N-R-K

IMO, this is better done via a script like sxiv-rifle.

Also there's a couple hacky things going on with that patch such as looping through the entire filelist for every single file. And then looping through it again to find the initial file.

https://github.com/qsmodo/sxiv/blob/7888d0017b3eb60e38dca5bb2c13d75f15d1ab14/main.c#L130-L134 https://github.com/qsmodo/sxiv/blob/7888d0017b3eb60e38dca5bb2c13d75f15d1ab14/main.c#L931-L936

On my system, this ends up being noticeably slower than the sxiv-rifle script (run via dash) when opening large directories.

Yea well I want to implement it into my gui fm pcmanfm, which is kinda picky with what works and what not. I wasn't able to get sxiv-rifle working in there. I don't need sxiv-rifle when in my terminal when I can simply use -F $1 "$(pwd)" in my little sxiv view script. But it doesn't work in pcmanfm somehow.. I can recall having it working somehow in the past but I forgot how..

fov95 avatar Mar 15 '22 04:03 fov95

I had used pcmanfm to launch images via the sxiv-rifle script in the past just fine.

You probably just need to add a .desktop entry. Try copying the sxiv desktop entry and under Exec replace sxiv with /path/to/sxiv-rifle. https://github.com/muennich/sxiv/blob/master/sxiv.desktop

N-R-K avatar Mar 15 '22 04:03 N-R-K

That's weird because I used the same command in pcmanfm and it didn't work. Now with the desktop file it does work. This should not be an issue imo. Thanks.

Oups.. So I got a file named 416x416.PNG and the rifle script refuses to open it. It works fine with sxiv alone.

fov95 avatar Mar 15 '22 05:03 fov95

Oups.. So I got a file named 416x416.PNG and the rifle script refuses to open it. It works fine with sxiv alone.

That's a bug with the current sxiv-rifle script, it checks the file extension only in lower case. Consider applying this patch https://github.com/ranger/ranger/pull/2586/.

N-R-K avatar Mar 15 '22 05:03 N-R-K

With that it only opens a single image

fov95 avatar Mar 15 '22 05:03 fov95

With that it only opens a single image

Works fine on my end, what's the filename of image you're trying to open?

N-R-K avatar Mar 15 '22 05:03 N-R-K

I forgot to add that it oes not work with pcmanfm. it does from terminal however

fov95 avatar Mar 15 '22 05:03 fov95