From 765b068e86fc26173f1f367ddc6d2be57129f98e Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Thu, 14 May 2026 18:26:50 -0400 Subject: [PATCH] Add omarchy-menu wrapper for ergonomic CLI use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `omarchy-shell-ipc menu toggle root` is what the keybinds use \u2014 it skips the omarchy CLI dispatch hop and stays sub-ms. But humans don't want to type that. New tiny wrapper restores `omarchy menu …` as the CLI entry point: omarchy menu → toggle root (bare invocation) omarchy menu toggle [route] → toggle, route defaults to root omarchy menu summon [route] → always open omarchy menu close → close if open omarchy menu refresh → re-parse the menu JSONCs omarchy menu ping → health check Internally each verb just execs `omarchy-shell-ipc menu …`. The omarchy-CLI dispatcher overhead measures ~2ms on top of the direct IPC path (32ms → 34ms keybind-to-visible), so the wrapper is fine for any human-typed invocation; keybinds and the bar icon stay on omarchy-shell-ipc to keep that ~30ms hot path. Sibling `omarchy menu file`, `omarchy menu input`, etc. still resolve through their own bins \u2014 the dispatcher picks the longest matching prefix, so longer routes ("omarchy menu file") win over the bare "omarchy menu" entry. --- bin/omarchy-menu | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 bin/omarchy-menu diff --git a/bin/omarchy-menu b/bin/omarchy-menu new file mode 100755 index 00000000..bc3b30ff --- /dev/null +++ b/bin/omarchy-menu @@ -0,0 +1,41 @@ +#!/bin/bash + +# omarchy:summary=Control the Omarchy menu (toggle / summon / close / refresh) +# omarchy:args=[toggle|summon|close|refresh|ping] [route] +# omarchy:examples=omarchy menu | omarchy menu toggle system | omarchy menu summon style.theme | omarchy menu refresh + +# Thin wrapper around `omarchy-shell-ipc menu`. Keybinds and the bar icon +# call omarchy-shell-ipc directly to skip the omarchy-CLI dispatch hop; +# this exists so humans get `omarchy menu toggle X` etc. + +verb="${1-toggle}" +route="${2-root}" + +case "$verb" in + toggle | summon) + exec omarchy-shell-ipc menu "$verb" "$route" + ;; + close | refresh | ping) + exec omarchy-shell-ipc menu "$verb" + ;; + -h | --help | help) + cat <, or close it if already open. Default verb. + summon [route] Always open the menu (no close-if-visible toggle). + close Close the menu if it is visible. + refresh Re-parse the menu JSONC files. + ping Health check. + +Route is an item id (e.g. setup.power) or alias (e.g. power). Defaults to +"root", which opens the top-level menu. +USAGE + exit 0 + ;; + *) + echo "omarchy-menu: unknown verb '$verb'. Try 'omarchy menu --help'." >&2 + exit 2 + ;; +esac