Omahub
← All plugins
C

DefThis

by Craig Bullard

Define the selected word or the word at the text cursor in a fast, offline-capable dictionary overlay.

Security review

No obvious issues detected

Deterministic scan — not a security guarantee

None
Risk level
None
Analyzed commit
fe7cef8
Scanned
1 month ago

No potentially dangerous behavior detected in the analyzed commit.

Automated analysis only — not a security guarantee.

AI advisory review

No obvious issues detected

Language-model assessment · ~deepseek/deepseek-v4-flash-latest — advisory only

Low
AI risk level
Low
Recommendation
install
Model
~deepseek/deepseek-v4-flash-latest
Analyzed commit
fe7cef8
Reviewed
1 month ago

DefThis is a dictionary overlay that reads the selected word or cursor word, fetches definitions from Wiktionary over HTTPS, and caches results locally. It installs a small helper script into ~/.local/bin and uses hyprctl to simulate key presses for word selection, all of which are user-initiated and documented. The backend enforces strict bounds on network responses, cache size, and file permissions, and no obfuscated or malicious code was found.

  • Reads the focused application's accessible text and the Wayland primary selection when summoned, which is a privacy consideration but is user-initiated and limited to the lookup term.
  • Installs a helper script into ~/.local/bin and simulates key presses via hyprctl; these actions are documented and necessary for the plugin's functionality.
How this check works

This review combines the deterministic scan (the rule-based results above) with an independent look at the plugin's code by a language model. The model reads a trimmed sample of the repository's files, the manifest, and the README, then gives a plain-language risk level and a recommendation: install (no notable danger), review (look closer first), or avoid (clearly dangerous).

It runs on the same analyzed commit as the deterministic scan and is strictly advisory — it is not a security guarantee and never blocks a plugin by itself. A human moderator still reviews plugins before they are listed.

AI advisory only — automated analysis, not a security guarantee.

Install
$ omarchy plugin add https://github.com/cbullard/defthis --enable
Productivity #quickshell

DefThis

Select it—or place the text cursor inside it. DefThis.

DefThis is an Omarchy shell overlay that defines the word selected in the focused text control, or the word containing its text cursor, without leaving the application you are using.

Definitions come from Wiktionary. Successful lookups are cached locally, so previously looked-up words remain available offline and can be revisited from the Recent words view. When Wiktionary identifies a noun as a plural form, DefThis follows that entry and displays the definition of its singular form instead.

Requirements

  • Omarchy Quattro
  • Python 3.10 or newer
  • AT-SPI and PyGObject for best-effort accessible-text lookup (included with Omarchy)
  • wl-clipboard for reading the Wayland primary selection
  • An internet connection for the first lookup of a word

The plugin runs inside the existing Omarchy shell process. It does not start a second Quickshell instance or require elevated privileges.

Install

omarchy plugin add https://github.com/cbullard/defthis.git --enable

Add a shortcut

DefThis installs its small omarchy-defthis shortcut command into ~/.local/bin/ when the plugin first loads. Add either or both bindings to ~/.config/hypr/bindings.lua:

o.bind("SUPER + ALT + D", "DefThis selection", "omarchy-defthis selection")
o.bind("ALT + SHIFT + D", "DefThis at cursor", "omarchy-defthis cursor")

Hyprland reloads the bindings automatically. The shortcut text is entirely user-configurable; change either combination to any unused binding. Check existing bindings with omarchy menu keybindings --print.

Usage

  1. Select one word and press Super+Alt+D, or place the text cursor inside a word and press Alt+Shift+D.
  2. The cursor shortcut selects the word using the focused application's normal word-navigation behavior before opening DefThis.
  3. Press H while DefThis is open to toggle Recent words.
  4. Press Space while DefThis is open to type a word directly; Enter looks it up and Escape cancels the input.
  5. Press Escape or click outside the card to close it.

The cursor shortcut sends Ctrl+Right, followed by Ctrl+Shift+Left, to the focused application and then reads its Wayland primary selection. Word boundaries therefore follow the application's own editing behavior. Directly summoning the overlay without a shortcut mode retains best-effort AT-SPI lookup and falls back to the primary selection.

Press O while the overlay is open to view the full Wiktionary entry.

In Recent words, use the arrow keys to move and Enter to reopen a definition. Press Delete to remove the selected word and its cached definition. The Clear button removes all saved words and definitions after confirmation.

For development, a word can be supplied directly without changing the primary selection:

omarchy-shell shell summon io.github.cbullard.defthis '{"term":"serendipity"}'

Privacy and storage

Lookup terms are sent to Wiktionary only when a needed definition is not already cached. Recent definitions and plural-to-singular aliases are stored in ${XDG_CACHE_HOME:-$HOME/.cache}/omarchy-defthis.json, along with a most-recent-first list of up to 50 words without timestamps. The singular resolver uses the inspectable Python helper and its separate bounded cache at ${XDG_CACHE_HOME:-$HOME/.cache}/omarchy-defthis/cache.json; its Wiktionary responses are limited to 1 MiB, and its cache is limited to 100 entries and 1 MiB with atomic, owner-only updates. Focused accessible text is inspected only when the overlay is summoned, with both the traversal and its runtime bounded. The primary selection fallback is also read through the helper with a 1 KiB limit. No clipboard or accessibility watcher runs in the background. Saved lookup data can be removed from Recent words.

Wiktionary text is available under the Creative Commons Attribution-ShareAlike License. The plugin UI links every result back to its Wiktionary entry.

Validate

omarchy plugin validate .
qmllint -I "$OMARCHY_PATH/shell" DefThis.qml
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests -v
env -u QT_QPA_PLATFORMTHEME QT_QPA_PLATFORM=offscreen \
  /usr/lib/qt6/bin/qmltestrunner -input tests

Remove

Remove the shortcut lines from ~/.config/hypr/bindings.lua, then run:

omarchy plugin remove io.github.cbullard.defthis
rm ~/.local/bin/omarchy-defthis