Skip to content

Open the whole folder in the image viewer - #11294

Open
elladann wants to merge 1 commit into
omacom:quattrofrom
elladann:imv-dir-desktop
Open

elladann wants to merge 1 commit into
omacom:quattrofrom
elladann:imv-dir-desktop

Conversation

@elladann

Copy link
Copy Markdown

Fixes #11292.

applications/imv.desktop runs imv %F. A file manager passes only the file you clicked, so imv is handed a one-image playlist and next/prev — the arrow keys, [/], n/p — have nowhere to go. Up/Down still zoom, so it reads as "the arrow keys are broken" rather than "there is nothing to navigate to."

The imv package already ships /usr/bin/imv-dir for exactly this:

#!/bin/sh -efu
if [ $# -ge 2 ]; then
  exec imv "$@"
else
  exec imv -n "$1" "$(dirname "$1")"
fi

So a single image opens its whole containing folder and starts on the one that was clicked, while a multi-file selection passes straight through to imv unchanged. No new dependency — imv-dir comes from the same imv package already in omarchy-base.packages.

The migration refreshes the copy in ~/.local/share/applications/, following the same shape as the Docker.desktop refresh in 1787580187.

This was reported before in #4050 and closed with "Arrow keys only work when you open multiple images at once" — true of imv as invoked, but three people followed up saying it still wasn't what they expected, and one posted a hand-rolled sh -c wrapper doing what imv-dir already does. Opening a folder's worth of images from one click is what eog, gwenview and Loupe all do.

Testing

./test/all: 231 of 236 test files pass. The 5 failures (config, locate, runtime-smoke, snapper, unowned-system-paths) fail identically on quattro without this change — they want an omarchy-pkgs checkout or a clean graphical session.

Migration checked against temporary homes for all three states:

  • no ~/.local/share/applications/imv.desktop → no-op, exit 0
  • stock Exec=imv %F → rewritten to Exec=imv-dir %F
  • run again → unchanged, exit 0

Verified on the running desktop: after the change, gio open ~/Downloads/Armero.png launches

imv-wayland -n /home/elladan/Downloads/Armero.png /home/elladan/Downloads

and left/right walk the folder.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QwfWKHRhdugyEYHc28UsP1

imv.desktop ran `imv %F`. A file manager passes only the clicked file, so
imv got a one-image playlist and next/prev never had anywhere to go. Use
`imv-dir`, shipped with the imv package, which opens the containing
directory starting on the clicked file and passes a multi-file selection
through unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QwfWKHRhdugyEYHc28UsP1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

imv.desktop uses imv %F, so opening an image from a file manager gives a one-image playlist and Left/Right never navigate

1 participant