Repository navigation
Let apps read and change named shortcuts with omarchy shortcut - #16131
Draft
nchudleigh wants to merge 16 commits into
Draft
nchudleigh wants to merge 16 commits into
nchudleigh wants to merge 16 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
nchudleigh
force-pushed
the
feat/omarchy-shortcut
branch
from
October 21, 2026 15:25
bb84026 to
8a17da6
Compare
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apps need a way to change global shortcuts without writing Hyprland config. This adds
omarchy shortcutso an app can read and change a named shortcut, and Omarchy itself binds it and resolves conflicts. It replaces the approach in #14629.o.shortcut(id, spec)and their default keys. Dictation is the first:omarchy.dictation.toggleandomarchy.dictation.hold. Apps register their own under reverse-DNS ids, and can change the keys ofomarchy.*shortcuts but not what they run.field=valuelines in~/.config/omarchy/shortcuts/<id>. Other programs write these files, so they are read as data and never loaded as Lua.setandresetapply at once withhyprctl eval 'o.shortcuts.apply({"<id>", ...})', with no reload. Only the shortcuts a change names are rebound, so anything the user or a dictation backend unbound since the config loaded is left alone.get,listandsetask the running compositor what is bound, so they never show stale keys.setneeds Hyprland running, because only the running config knows Omarchy's default keys and every other binding.setrefuses keys that a live binding or another named shortcut already uses. It exits 2 and names who holds them. With--jsonit returns{keys, description, id, submap, can_take}per conflict, so an app's shortcut recorder can offer to take them.--forcetakes keys from another named shortcut, which keeps the rest of its keys, or from one of Omarchy's defaults, which comes back when the shortcut moves off its keys. That one case uses a reload, since only the config knows what the default was.--forcecan't take keys bound in the user's ownbindings.lua, by a dictation backend, or inside a submap. Those would come back at the next reload, or the submap would break.--releasemakes a hold shortcut such as push-to-talk, built ono.bind_hold. A modifier pressed on its own (Super_R,Alt_R) is matched with the modifier mask ignored, so apps don't need to know that Hyprland quirk. Rebinding a hold while its key is down finishes the hold first, so dictation never keeps recording.SUPER + mouse:275). Double-press is left to Support double-press actions in Hyprland bindings #13576.How Hyprland's
hl.unbindbehaves shapes the design. It matches the text a key was bound with, not the chord. It removes the key from every submap. Andhl.unbind("all")clears every binding. So keys are validated in the CLI and in Lua (all,catchalland empty chord parts are refused), and taking a default unbinds it by its own spelling, whicho.bindnow records.The full reference is in
docs/shortcuts.md.Validation
test/shell.d/shortcuts-test.shuses anhl.unbindstub that matches by text and treatsallas Hyprland does. It covers:hyprctl: conflicts by keysym, keycode, release-only binding and submap;--forceand what it can't take;--none;reset; Hyprland not running; an unreadable snapshot; an unwritable registry; and the reload fallback for older configsdictation-test.shchecks the dictation shortcut names. Its stub previously crashed in Lua and still reported ok../test/cli. The tests pass at every commit.allwas refused, andresetunbound it. The other 285 bindings stayed.🤖 Generated with Claude Code