pqiv
pqiv copied to clipboard
(Auto)browse mode, single images and desktop files
When using pqiv from a file manager to open images, it has the impractical property that only single files get opened. That behavior makes sense from a command line perspective (if you wanted all images, you'd say pqiv .). But from a file manager user's perspective, the common behavior of other image viewers (eom, geeqie, ristretto, gthumb -- but not feh) is that when a single image is viewed, the others around can be navigated to.
Things are different when multiple images are given (which is something many file manager users don't know even works): Then at least those I tried (ristretto and gthumb) constrain the user to the selected images.
I think this behavior would make sense for pqiv too, and suggest one of two paths there:
- Implicitly set
--browsewhen only a single file is passed. - Have an
--auto-browseoption that sets browse if exactly one file is given as an argument. This would then be set in the .desktop file, and the command line interface behaves as it always has.
My personal preference is for 1, as there is little value in having no navigation at all. The downside of 1 is that if pqiv is used in some locked down mode (say, a kiosk that only allows access to some given pictures, be it in regular or slideshow mode), then the case of one image would be special compared to many images. (Adding a --no-browse option for such cases would restore them, but needs manual interaction from these users).
One thing I don't understand is why you can't just use --browse in the desktop file - does your file manager support passing multiple files as command line arguments?
--browse was added specifically for file managers - on the command line, you could just specify a folder name or use wildcard expansion to add all files, as you already mentioned..
One thing I'm not sure about is whether this case is too advanced to warrant adding it as a feature - a three line bash wrapper script will do the job for power users.
That said, I'm open for option two.
Thunar does support multiple files as command line arguments (click, shift-click for a range, or click, ctrl-click for a selection, and then press return or right-click/open-with); pqiv indicates support for this by having a .desktop file with a capital %F.
The downside of just putting --browse in the desktop file is that it'd break opening multiple files; it still opens the full folder. (Testing this, it may actually be a bug in browse that makes it worse yet by hiding the second passed file, gotta try some more).
If file managers are the target audience of --browse already, then that should be (PR at https://github.com/phillipberndt/pqiv/pull/204) a good first step. For anything further, I'll look deeper into what --browse actually does when invoked with multiple arguments. If that turns out to be broken, maybe it's best to just make it a no-op in presence of multiple files.