Skip to content

Let screenshots skip the file and go clipboard-only - #9714

Open
gabrielforster wants to merge 1 commit into
omacom:quattrofrom
gabrielforster:screenshot-save-file-config
Open

Let screenshots skip the file and go clipboard-only#9714
gabrielforster wants to merge 1 commit into
omacom:quattrofrom
gabrielforster:screenshot-save-file-config

Conversation

@gabrielforster

Copy link
Copy Markdown

What

Print Screen always writes a PNG next to the clipboard copy. For people who only ever paste their screenshots, that's a pictures directory that fills up with files nobody opens, and today the only way out is to rebind the key to omarchy capture screenshot smart copy — which also loses the notification.

This adds OMARCHY_SCREENSHOT_SAVE_FILE. Set it to false and the default flow copies to the clipboard without writing anything:

export OMARCHY_SCREENSHOT_SAVE_FILE=false

Details

  • Only a literal false turns saving off, so a typo can't silently discard screenshots.
  • The positional copy / save arguments are untouched — omarchy capture screenshot fullscreen save still writes a file with saving turned off.
  • With no file, the notification drops the thumbnail and the editor action and just says the shot is on the clipboard; there'd be nothing on disk for the editor to open.
  • Creating the screenshot directory moved out of the top of the script into the branches that actually write there, so turning saving off doesn't leave an empty ~/Pictures behind.
  • Documented in the manual (screenshots page + a FAQ entry), the capture skill, and the commented default/uwsm/default example next to OMARCHY_SCREENSHOT_DIR.

Testing

  • New test/shell.d/screenshot-save-file-test.sh stubs the compositor, picker, clipboard and notifier and covers: default still saves, false writes no file and creates no directory, false still copies to the clipboard, an explicit save argument overrides it, and an unrecognized value keeps saving on.
  • ./test/cli clean; ./test/shell has the same 4 failures on this branch as on quattro (config, runtime-smoke, snapper, unowned-system-paths — all environment-related and unrelated to this change).
  • Verified live on a running session: with OMARCHY_SCREENSHOT_SAVE_FILE=false the shot landed on the clipboard as image/png with no file and no directory created, and the "Screenshot copied to clipboard" notification rendered; the default run wrote the file as before.

Notes

🤖 Generated with Claude Code

Print Screen always wrote a PNG next to the clipboard copy, so people who
only ever paste their screenshots accumulated a directory they never look
at. OMARCHY_SCREENSHOT_SAVE_FILE=false keeps the clipboard copy and drops
the file, and the notification loses the editor action since there is
nothing on disk to open. Only an explicit "false" turns saving off, and
the positional copy/save arguments still mean what they say.
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.

1 participant