Omahub
← All plugins
A

AI Grammar

by Ahmet Hasdemir

Correct or enhance selected text with Gemini directly from the Omarchy bar.

Security review

Review recommended · 2 findings

Deterministic scan — not a security guarantee

Low
Risk level
Low
Analyzed commit
5fa625e
Scanned
1 month ago

Flagged patterns appear only in documentation files (README / docs) — descriptive examples, not executable code.

  • Docs external_hosts README.md:108

    Downloads or connects to an external HTTP(S) host.

    git clone https://github.com/ahasdemir/hypr-ai-grammar.git
  • Docs sudo README.md:28

    Command runs with sudo, elevating the process beyond the plugin environment.

    sudo pacman -S --needed wl-clipboard wtype jq curl libnotify

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
5fa625e
Reviewed
1 month ago

The plugin is a straightforward bar widget that reads selected/clipboard text and sends it to the Google Gemini API for grammar correction or enhancement. The deterministic scan flags are in documentation-only snippets (README install commands), not in executable code, and the sampled scripts behave as described with no obfuscation, hidden persistence, or destructive actions.

  • Selected text is transmitted to Google Gemini by design; users should not run it on secrets or sensitive content, as the README itself warns.
  • The plugin requires and stores a Gemini API key locally in ~/.config/ai-grammar/.env; file permissions are set to 600, which is appropriate.
  • The automated scan flagged README commands involving sudo and git clone, but these are manual setup instructions for required packages and standalone usage, not part of plugin execution.
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/ahasdemir/hypr-ai-grammar --enable
Productivity #bar #quickshell #ai

AI Grammar for Hyprland and Omarchy Quattro

Correct or polish selected text with Gemini without leaving the application you are using. The project works as a standalone Hyprland helper and as an Omarchy Quattro bar plugin.

<p align="center"> <img src="assets/main-panel.png" alt="AI Grammar Main Panel" width="400"/> <img src="assets/settings-panel.png" alt="AI Grammar Settings" width="400"/> </p>

The ✦ AI Grammar bar icon opens a small panel with quick text actions, custom prompts, and settings:

  • Fix grammar corrects spelling and grammar while retaining the original wording, tone, slang, casing, and emojis.
  • Enhance text corrects the text and improves clarity, flow, and vocabulary for its context.
  • Quick Actions: Fix, Enhance, Formal, Casual, Summarize, Translate to Target, Translate to English.
  • Custom Prompt: Type custom instructions (e.g. "format as bullet points").

Selected text is read from the Wayland primary selection first, then the regular clipboard. The response replaces the selected text by pasting it into the focused application.

Requirements

  • A Wayland desktop
  • A Gemini API key
  • wl-clipboard, wtype, jq, curl, and libnotify

On Arch, CachyOS, or Omarchy:

sudo pacman -S --needed wl-clipboard wtype jq curl libnotify

Omarchy Quattro

Install the plugin directly from this repository:

omarchy plugin add https://github.com/ahasdemir/hypr-ai-grammar.git --enable

The plugin is placed in the right section of the Omarchy bar by default. Click the ✦ icon, select an action, and the selected text is processed in place.

Click the panel's ⚙ button to open settings. The built-in list starts with free-tier Gemini Flash and Flash-Lite models; gemini-3.6-flash is the default. Use Custom model to enter another Gemini model code supported by your account.

Configure the API key

Create a user configuration file. It remains outside the plugin repository and is never committed:

mkdir -p ~/.config/ai-grammar
cp .env.example ~/.config/ai-grammar/.env

Set the key in ~/.config/ai-grammar/.env:

GEMINI_API_KEY="your_gemini_api_key"

The script also accepts a GEMINI_API_KEY environment variable. A .env beside ai-grammar.sh is useful when running the repository checkout directly, but should remain untracked.

Bar placement and removal

# Move the icon anywhere in the bar.
omarchy bar move ahasdemir.ai-grammar --section right

# Remove the plugin and its local checkout.
omarchy plugin remove ahasdemir.ai-grammar

Keyboard shortcuts

The bar widget is optional. Add these bindings to ~/.config/hypr/bindings.lua to keep the original shortcuts under Omarchy Quattro:

o.bind(
  "ALT + SPACE",
  "AI grammar fixer",
  "bash ~/.config/omarchy/plugins/ahasdemir.ai-grammar/ai-grammar.sh fix",
  { non_consuming = true }
)
o.bind(
  "ALT + SHIFT + SPACE",
  "AI text enhancer",
  "bash ~/.config/omarchy/plugins/ahasdemir.ai-grammar/ai-grammar.sh enhance",
  { non_consuming = true }
)

Reload and validate the Hyprland configuration after editing it:

hyprctl reload
hyprctl configerrors

For legacy Hyprland .conf configurations, use the equivalent bindings:

binddn = ALT, SPACE, AI Grammar Fixer, exec, /path/to/ai-grammar.sh fix
binddn = ALT SHIFT, SPACE, AI Text Enhancer, exec, /path/to/ai-grammar.sh enhance

Standalone use

Clone the repository, configure .env, and run either mode manually:

git clone https://github.com/ahasdemir/hypr-ai-grammar.git
cd hypr-ai-grammar
cp .env.example .env
chmod +x ai-grammar.sh

# With text selected in the focused Wayland application:
./ai-grammar.sh fix
./ai-grammar.sh enhance

Privacy

The selected text is sent to the configured Google Gemini API endpoint for processing. Do not run the tool on secrets or other content you do not want to send to that service.

License

MIT