Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Omarchy Web Search

A native Omarchy Shell bar plugin for quick web search. Click the icon, type a query, and press Enter — the results open in your default browser.

Features

  • Clickable bar icon (a magnifying glass) that opens a compact search panel.
  • The panel header mirrors the selected engine — its icon, "Searching with Google" / "Asking Claude", and the shortcut that reselects it.
  • Text field pre-fills with your last query and auto-selects it for quick retries. Its placeholder follows the engine ("Search GitHub…", "Ask ChatGPT…"), and the trailing ↵ runs the search on click.
  • Ten built-in search engines as a labelled five-across grid, each tile showing its icon, name, and shortcut number: Google, ChatGPT, Claude, Bing, DuckDuckGo, GitHub, Wikipedia, YouTube, Reddit, and Stack Overflow. ChatGPT and Claude pre-fill a prompt in chatgpt.com / claude.ai.
  • Ctrl+1Ctrl+9 picks engines by tile number, and Ctrl+0 picks Stack Overflow, so every engine is reachable without leaving the keyboard (Google → Ctrl+1, ChatGPT → Ctrl+2, Claude → Ctrl+3, …).
  • The default engine is configurable per-widget; clicking a tile or pressing its shortcut changes it for the current search only.
  • An optional global Hyprland shortcut opens or closes the panel from anywhere — Super+Alt+P by default when installed with scripts/bindings.py (see below) — and is listed in the panel's keycap legend along with Enter, Ctrl+0–9, and Esc.
  • Enter opens the results in your default browser (omarchy launch browser), which reuses an already-running browser window and adds a new tab.
  • Esc closes the panel without running a search.
  • Supports shell IPC (open, close, toggle, show, hide).

No privileges are required. The query is URL-encoded before being passed to the browser, and commands are passed as argument arrays (no shell command strings are evaluated).

Requirements

  • Omarchy with the Quickshell bar (omarchy.bar)
  • A default web browser set via xdg-settings (checked by omarchy launch browser)
  • Python 3, only when using the optional global-shortcut helper

Install

omarchy plugin add https://github.com/sahzudin/omarchy-search.git --enable

The plugin does not change your Hyprland configuration during installation. To opt into the optional Super+Alt+P global shortcut, run:

python3 ~/.config/omarchy/plugins/io.github.sahzudin.omarchy-google-search/scripts/bindings.py install

The helper first verifies that the key is free, safely backs up ~/.config/hypr/bindings.lua, adds one clearly marked binding block, and reloads Hyprland. It refuses symlinks and non-regular files anywhere in that path and atomically replaces the configuration only after the backup and new contents have been synced. The plugin itself works normally without this shortcut.

For local development, link the checkout into the user plugin directory and enable it:

ln -s ~/Projects/omarchy-search \
      ~/.config/omarchy/plugins/io.github.sahzudin.omarchy-google-search
omarchy plugin enable io.github.sahzudin.omarchy-google-search left

Saved changes under ~/.config/omarchy/plugins/ reload automatically. If a change does not apply, force a reload:

omarchy-shell shell rescanPlugins

Usage

  • Left-click the magnifying glass — open the search panel and focus the query field.
  • Type a query and press Enter — open the results for the selected engine in your browser.
  • Press Ctrl+1Ctrl+9 (or click a tile) to pick the search engine, then press Enter.
  • Press Esc — close the panel without searching.

Configuration

Per-widget settings go in the widget's entry in ~/.config/omarchy/shell.json under bar.layout.<section>:

{
  "id": "io.github.sahzudin.omarchy-google-search",
  "defaultEngine": "google",     // id of the engine preselected when the panel opens
  "openShortcut": "SUPER + ALT + P", // global panel shortcut (Hyprland combo)
  "icon": "󰍋"                    // any Nerd Font glyph
}

Engine ids: google, chatgpt, claude, bing, duckduckgo, github, wikipedia, youtube, reddit, stackoverflow.

The file hot-reloads on save.

Change the global shortcut

The panel's open/close shortcut is a managed Hyprland binding in ~/.config/hypr/bindings.lua (a marked block between -- BEGIN Web Search managed binding and the matching -- END). Change it safely with the helper; it backs up the file, refuses to steal a key bound elsewhere, updates the widget's openShortcut setting, and reloads Hyprland:

python3 scripts/bindings.py set "SUPER + CTRL + K"   # bind a new key
python3 scripts/bindings.py remove                    # drop the binding
python3 scripts/bindings.py status                    # show the active key

install re-binds the last-used key (or SUPER + ALT + P). Because the key must be free, Hyprland may restart the shell or ask you to log in again if a binding changes. To set it manually instead, remove the managed block and add o.bind("<KEY>", "Web search", "omarchy-shell shell toggle io.github.sahzudin.omarchy-google-search {}").

Remove

omarchy plugin remove only unlinks the plugin folder and rewires the bar; it does not touch the Hyprland keybinding written to ~/.config/hypr/bindings.lua, so drop that first:

./uninstall.sh            # removes the managed binding block (see scripts/bindings.py)
omarchy plugin disable io.github.sahzudin.omarchy-google-search
omarchy plugin remove io.github.sahzudin.omarchy-google-search

The widget's per-widget settings (including openShortcut) live in the widget entry in shell.json and are removed together with the entry.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages