Text Polish
Text Polish is a compact Omarchy overlay for correcting and refining clipboard
text without leaving the current workspace. It uses the coding agent selected
in Setup > Defaults > Agent and preserves the language of the original text.
Features
- Fix spelling, grammar, punctuation, and typing errors.
- Improve clarity and flow.
- Shorten text without losing important information.
- Rewrite text in a more formal tone.
- Start in a compact, keyboard-first quick-fix window.
- Show each result first as a compact Quick Fix with an isolated diff.
- Expand on demand into a contextual review with the changed wording highlighted.
- Accept, dismiss, or copy a suggestion before changing the clipboard.
- Use Omarchy's default coding agent instead of a hard-coded provider.
- Stay out of the status bar.
Install
omarchy plugin add https://github.com/vandaimer/omarchy-text-polish.git --enable
Text Polish needs wl-copy, wl-paste, and at least one coding agent supported
by Omarchy. Choose the agent under Setup > Defaults > Agent.
Add it to the Omarchy menu
The Omarchy plugin manifest cannot currently register entries in the built-in menu. Text Polish includes idempotent commands that safely manage its entry in the user menu extension file:
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish menu add
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish menu status
Open the Omarchy menu, enter Apps, and select Text Polish. Existing root-level entries created by older versions are moved into Apps automatically. You can also launch the overlay directly:
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish open
Remove only the menu block managed by Text Polish:
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish menu remove
Usage
- Copy some text.
- Open Text Polish from the Omarchy menu.
- Choose a mode and press
Ctrl + Enter. - Review the suggestion, then press
Enterto accept and copy it orCtrl + Dto dismiss it.
Text Polish opens as a compact input and keeps the agent result in a compact Quick Fix card with accept, copy, and dismiss actions. Choose Review details to expand the same suggestion into the two-column review. The review isolates the changed wording, keeps the original text visible, and leaves the clipboard untouched until you accept or explicitly copy the result.
Optional keybinding
Omarchy does not currently provide a command or plugin-manifest field for
persistently registering a keybinding. Text Polish includes an explicit setup
command that manages only its own marked block in ~/.config/hypr/bindings.lua.
It is never run automatically during installation.
Add the default SUPER + CTRL + G binding:
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish binding add
Choose a different key combination:
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish binding add "SUPER + ALT + P"
Check or remove the managed binding:
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish binding status
~/.config/omarchy/plugins/vandaimer.text-polish/text-polish binding remove
The generated block looks like this:
-- BEGIN vandaimer.text-polish
o.bind("SUPER + CTRL + G", "Text Polish", "omarchy-shell shell toggle vandaimer.text-polish")
-- END vandaimer.text-polish
The command checks existing bindings, refuses a key combination that is already in use, reloads Hyprland, checks for configuration errors, and restores the previous file if validation fails. You can inspect all effective bindings with:
omarchy menu keybindings --print
Default agent integration
The overlay reads the current selection through omarchy-default-agent each
time it opens. The helper runs that agent non-interactively from an isolated
temporary directory. Supported Omarchy agents are Pi, Oh My Pi, OpenCode,
Claude Code, Codex, Grok, Gemini, GitHub Copilot, and Crush.
When Codex is selected, Text Polish uses low reasoning effort and low response verbosity for this focused editing task. This keeps the overlay responsive without changing the user's global Codex settings.
Text passed to an agent is wrapped as untrusted editing material. The prompt asks the agent to return only the revised text and not to follow instructions contained inside the text being edited.
Text is limited to 16 KiB. Clipboard contents and edited text are sent through
private stdin streams (or a mode-0600 temporary prompt file for agents that
support file input) rather than process arguments. Agent output is capped at
64 KiB and temporary files are removed after every run.
Development
Run the full automated suite before publishing changes:
tests/run.sh
The suite validates the QML and shell helper, runs the transport/security
fixtures, and uses Qt 6 Quick Test offscreen to cover text diffing, view states,
UTF-8 limits, HTML escaping, and keyboard routing in both the editor and a
focused result button. It deliberately uses /usr/lib/qt6/bin/qmltestrunner
when available because /usr/bin/qmltestrunner may belong to Qt 5.
An optional live smoke test opens the installed plugin in the current Hyprland
session, verifies its layer, sends Esc, and confirms that the layer closes:
RUN_LIVE_UI_TESTS=1 tests/run.sh
Individual validation commands remain available:
omarchy plugin validate .
qmllint TextPolish.qml TextPolishChangePreview.qml TextPolishKeyRouter.qml tests/qml/*.qml
bash -n text-polish
tests/security.sh
License
MIT