Repository navigation
Open the image when Open or Edit is clicked on a screenshot toast - #18807
ThePrimeagen wants to merge 3 commits into
Conversation
Screenshot and clipboard-image notifications previously relied on omasnap's libnotify Open/Edit actions, but omasnap exits after sending them so clicking dismissed the toast without opening anything. Both entry points now run omasnap without --notify and send their own notification via omarchy-notification-send with --action exec buttons (Open via imv, Edit via omasnap), which the shell runs after the sender exits. The screenshot wrapper discovers the new file in the screenshot directory after a successful capture and only toasts when a file was saved, preserving copy-only and cancel behavior. The previous drive showed this working in Case 1 (editor overlay opened, MON-DONE visible) and stalled only because the walker waited for the terminal prompt behind that overlay, which the revised test now handles with Esc, so no code change is needed.
[Medium impact] The PR appears safe to merge; the previous performance issue is fixed. SummaryThe PR moves screenshot notifications to
Reviews (3) · Last reviewed commit: "Find the new screenshot without a grep p..." · Reviewed by Greptile |
…opening The tests still expected omasnap to get --notify, and dropping it from the clipboard helper had replaced opening an image entry with a "Screenshot saved" toast for a file nobody saved. Opening an image entry runs omasnap on it again, without --notify, and both tests now expect the arguments without it. A native --save, as in "omarchy capture screenshot scroll --save", was announced as "Screenshot saved and copied", since only the bare words copy and save were counted. Both spellings count now. The toast took the newest new name in the screenshot directory, so a file another program wrote during the capture got the thumbnail and the Open and Edit buttons. Omasnap does not report the path it saves, so the toast now appears only when the capture added exactly one image; when more appeared, nothing is announced rather than the wrong file. Co-authored-by: Cursor <cursoragent@cursor.com>
Telling which image a capture added ran grep once for every PNG in the screenshot directory, so a folder of thousands of shots delayed the toast by as many process starts. The names present before the capture are now kept in one lookup and each file is checked against it in the shell. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing: the shell runs omasnap's Open and Edit buttons itself, so nothing calls back into the exited omasnap. Rebuilding the toast in the shell by watching ~/Pictures/Screenshots shows two toasts, drops Edit's --recent, misses omasnap's own save locations, and bypasses Do Not Disturb. The dead Open button needs its real cause found. Reviewed by Claude Opus 5.5 with Codex Medium as a second opinion; its independence is not guaranteed. |
Clicking Open or Edit on the "Screenshot saved" toast just dismisses it: no viewer or editor opens.
bin/omarchy-capture-screenshotandbin/omarchy-clipboard-openleave the toast toomasnap --notify, whose buttons call back to an omasnap process that has already exited.Screenshots
Reproduce
omarchy screenshot fullscreen save.More cases
Clicking Open
Related
--notify, which this change removesomarchy-notification-send --actionbuttons the shell runs itself, used here--notifyto an omasnap that lacked it broke every screenshot binding--exectoasts: the click lived only in the exited sender