Nemo view order in supported image viewers #2705
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow images to be viewed in supported image viewers in the same order as they are shown in the current nemo view (directory or search).
For example:
This is similar to how images are handled in Windows Explorer and Windows Photo Viewer, which I find so intuitive a feature, I didn't even think of it as one until moving to Linux on my personal machine.
So this is an implementation that seeks to address this in a way that doesn't require specific coupling between applications, or extensive changes to image viewers.
The interface the image viewer has to implement is a very simple one - it just has to accept a list of urls, and display them in the given order, rather than applying its own sorting. Bare bones image viewers like feh and sxiv already do this.
When opening a single image, nemo then checks if the default application to show it is on a list of supported ones, and sends the image viewer a list of all the image urls in the current view, in presented order. No extra application specific code / command line parameters are required.
Unfortunately the basic image viewers of various distros (xviewer, viewnior, ristretto) all seem to apply their own basic alphabetical sort to image lists, so there's an accompanying change to xviewer here, since it's very likely this will be available on systems with nemo.
This is a change I think would add unavailable and useful functionality (particularly those moving from Windows; I've seen a few posts elsewhere about people missing this), and not get in the way for people who don't need it.
Passing big url lists around seemed acceptably performant from a few unscientific tests. It passed a folder of 4000 images to xviewer with no issue, which only thumbnailed images in its gallery preview as it needed them.