omarchy-clipboard-plugin
Fork of the built-in Omarchy clipboard manager plugin
(omarchy.clipboard), deployed as the cloned plugin sspaeti.clipboard.
Changes vs. upstream
- OCR search: every captured image is run through
tesseract; the recognized text is stored asocrTextin the history entry and matched by the picker's search. Typing in the picker finds text inside screenshots. Ctrl+Iimages-only mode: toggles a filter that shows only image entries (header shows[images]). Typing then searches the OCR text.EscorCtrl+Ileaves the mode.- No accidental paste (walker-style):
Enter/ mouse click only copies the entry to the clipboard — paste yourself withCtrl+V(Ctrl+Shift+Vin terminals).Shift+Enterkeeps the old copy-and-auto-paste behavior.Alt+Enterstill opens the entry. - History limit raised from 300 to 500 entries (can be configured in shell.json)
- The plugin uses its own
capture.shinstead of the stock one under$OMARCHY_PATH(needed so OCR actually runs). - Security hardening: clipboard content renders as
Text.PlainText(copied HTML markup can't trigger rich-text rendering or remote image loads), andgc.shdeletes captured image files once their history entries are deleted, evicted, or cleared.
Install
# OCR engine (skip if you don't want OCR search)
omarchy pkg add tesseract tesseract-data-eng
# clone straight into ~/.config/omarchy/plugins/ and enable
omarchy plugin add https://github.com/sspaeti/omarchy-clipboard-plugin.git --enable
This replaces the built-in clipboard manager — the stock keybinding and
omarchy menu clipboard route to this plugin automatically (via
clonedFrom in the manifest). Optionally OCR images already in your
history:
~/.config/omarchy/plugins/sspaeti.clipboard/scripts/backfill-ocr.sh
Update later with omarchy plugin update sspaeti.clipboard, uninstall with
omarchy plugin remove sspaeti.clipboard (the built-in comes back).
Customization
All settings live on this plugin's entry in the plugins array of
~/.config/omarchy/shell.json. The file hot-reloads on save — no shell
restart needed. Every key is optional; leave one out and its default
applies.
After install the entry only has an id. Add settings next to it:
{
"version": 1,
"plugins": [
{
"id": "sspaeti.clipboard",
"historyLimit": 1000,
"maxRows": 50,
"ocr": true
}
]
}
| Key | Default | Meaning |
|---|---|---|
historyLimit |
500 |
max entries kept in the clipboard history (upstream keeps 300) |
maxRows |
50 |
max rows the picker shows per search |
ocr |
true |
run tesseract on newly captured images; false disables OCR (existing ocrText stays searchable) |
ocrLang |
"eng" |
tesseract language(s), e.g. "deu" or "eng+deu" — install packs with omarchy pkg add tesseract-data-deu |
autoPaste |
false |
true restores stock omarchy behavior: Enter/click copies and auto-pastes, Shift+Enter only copies. false swaps them (walker-style, no accidental paste) |
Examples:
{ "id": "sspaeti.clipboard", "ocr": false } // no OCR, everything else default
{ "id": "sspaeti.clipboard", "historyLimit": 2000 } // bigger history
Notes:
- OCR text is capped at 4000 characters per image (
OCR_MAX_CHARSincapture.sh). - History is stored in
~/.local/state/omarchy/clipboard-history.json, images in~/.local/state/omarchy/clipboard-images/.
Requirements
- Omarchy with the Quickshell-based shell (clipboard plugin era)
tesseract+ language data:omarchy pkg add tesseract tesseract-data-eng
Development
For hacking on the plugin from a working-copy checkout (instead of the
omarchy plugin add install above):
make deploy # copies plugin files to ~/.config/omarchy/plugins/sspaeti.clipboard/
make backfill-ocr # one-shot: OCR images already in your history
make test # unit tests for the history/search logic (node)
The shell hot-reloads the plugin on deploy. First-time setup on a fresh
machine: run omarchy plugin clone omarchy.clipboard once (registers and
enables the clone), then make deploy over it.
Keys
| Key | Action |
|---|---|
| type | search (matches text, filenames, and OCR text of images) |
Ctrl+I |
toggle images-only mode |
Enter / click |
copy to clipboard (with "autoPaste": true: copy and auto-paste) |
Shift+Enter |
copy and auto-paste (with "autoPaste": true: copy only) |
Alt+Enter |
open entry |
Del / Shift+Del |
delete entry / clear history |