Skip to content

Show each app's Hyprland hotkey on its row - #117

Closed
LucasMouraFranco wants to merge 3 commits into
typecraft-dev:mainfrom
LucasMouraFranco:feat/app-hotkeys
Closed

LucasMouraFranco wants to merge 3 commits into
typecraft-dev:mainfrom
LucasMouraFranco:feat/app-hotkeys

Conversation

@LucasMouraFranco

@LucasMouraFranco LucasMouraFranco commented Nov 26, 2026 •

Copy link
Copy Markdown

App rows now show the Hyprland bind that opens the app, as keycaps on the right of the row, the way Raycast shows a command's hotkey. On a default Omarchy setup, Ghostty shows Super ↵, the default browser Super Shift ↵, Files Super Shift F, and web apps, Obsidian, Neovim etc. get theirs.

How it works

  • Source: Omarchy's keybindings menu already resolves the Lua config's binds into records with their commands (~/.cache/omarchy/keybindings-*.records). services/KeybindingSource.qml runs omarchy-menu-keybindings --print to keep that cache current (~90 ms warm), reads the newest file, and reads the default terminal (xdg-terminals.list), browser (omarchy-cmd-default-browser) and editor. It rescans on start, on Hyprland configreloaded, and on show at most once a minute.
  • Matching (core/Keybindings.js, pure, unit-tested): each exec bind is matched to a desktop entry.
    • omarchy-launch-terminal / -browser / -editor go through the defaults, so switching your default browser moves the keycaps.
    • Web apps match by URL.
    • omarchy-launch-or-focus and the TUI launchers match by the program they start, and omarchy-launch-<app> by name.
    • A bare program matches by name. A command with arguments (alacritty -e ssh box), --private and pipelines mark nothing.
    • The first bind in Omarchy's order wins (Super Shift ↵ over Super Shift B for the browser).
  • UI: a KeyHint accessory in ResultRow, plus a "Hotkey" line in the About panel. The site demo is ported with Omarchy's default app binds.

No new dependencies, and nothing the user typed goes to argv.

Testing

  • node --test tests/*.test.js passes, including the new tests/keybindings.test.js.
  • omarchy plugin validate . passes.
  • Checked live on Omarchy (Hyprland 0.56): rootSearch.search returns the hotkeys, and a screenshot shows the keycaps on the favorited Ghostty, Zen Browser and Files rows.

Known miss: HEY's desktop entry runs omarchy-webapp-handler-hey instead of the web app URL, so it doesn't pick up Super Shift E.

🤖 Generated with Claude Code

LucasMouraFranco and others added 2 commits November 25, 2026 23:44
An app row now carries the bind that opens it as keycaps, the way Raycast
shows a command's hotkey: Ghostty gets Super ↵, the default browser
Super Shift ↵.

KeybindingSource reads Omarchy's own keybinding record cache (refreshed
through omarchy-menu-keybindings --print), plus the default terminal,
browser and editor. Keybindings.js matches each exec bind to a desktop
entry: Omarchy's terminal, browser and editor launchers through those
defaults, web apps by URL, launch-or-focus and TUI launchers by the
program they start, and a bare program by name. A command with
arguments marks nothing. The About panel lists the hotkey, and the site
demo shows Omarchy's default app binds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any row can get its own hotkey from the action panel (Record Hotkey /
Change Hotkey), like Raycast's command hotkeys. The recorder view takes a
chord with Super, Ctrl or Alt (F-keys alone are fine), shows conflicts with
other omacast hotkeys and Hyprland binds, and saves to settings.json
`commands[id].hotkey`. Remove Hotkey clears it, or unbinds the Omarchy bind
an app row shows; Restore Default Hotkey brings that bind back.

services/HotkeyBinder.qml applies the hotkeys at runtime with
`hyprctl eval` (hl.bind to hl.dsp.global("omacast:hk-…")), so omacast
writes no Hyprland config. It re-applies after every configreloaded, and
uses a config-only reload when a bind has to be given back. Each hotkey is
a GlobalShortcut in Launcher.qml; pressing it again while its view is open
closes the launcher. The argv carries only key names, hashed shortcut names
and row titles.

The website demo ports the recorder and the actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record, remove and restore hotkeys for any command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant