From bc75b03114c0bac8df63cb2269d582102b9686c3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 7 Aug 2026 02:38:06 -0700 Subject: [PATCH] Show plugin ids as subtext in the plugin picker menus Select-menu options gain an optional third field rendered under the label, filtered alongside it, and returned with the selection. The plugin picker uses it to show every plugin's id and act on the id the selection hands back, replacing the duplicate-name label suffix. Co-Authored-By: Claude Fable 5 --- bin/omarchy-menu-plugin | 17 +++++------- bin/omarchy-menu-select | 7 +++-- shell/plugins/menu/Menu.qml | 26 +++++++++++-------- test/shell.d/menu-plugin-test.sh | 44 +++++++++----------------------- test/shell.d/menu-test.sh | 16 ++++++------ 5 files changed, 48 insertions(+), 62 deletions(-) diff --git a/bin/omarchy-menu-plugin b/bin/omarchy-menu-plugin index 7182c6eb..9a876674 100755 --- a/bin/omarchy-menu-plugin +++ b/bin/omarchy-menu-plugin @@ -22,21 +22,18 @@ esac plugins=$(omarchy-plugin-list --json) -# Two plugins may share a name, so keep the id with the row and show it when the -# name alone cannot identify the pick. +# The id rides along as row subtext: it tells same-named plugins apart on +# screen and comes back with the selection as the key to act on. rows=$(jq -r --arg icon "$PLUGIN_ICON" \ ". as \$plugins - | ([.[] | select($filter)]) as \$rows - | \$rows[] - | .name as \$name - | (if ([\$rows[] | select(.name == \$name)] | length) > 1 then \$name + \" (\" + .id + \")\" else \$name end) as \$label - | \$icon + \"\\t\" + \$label + \"\\t\" + .id" <<<"$plugins") + | .[] | select($filter) + | \$icon + \"\\t\" + .name + \"\\t\" + .id" <<<"$plugins") [[ -n $rows ]] || { omarchy-notification-send "No plugin to ${1}"; exit 0; } -name=$(omarchy-menu-select "${1^} plugin" < <(cut -f1,2 <<<"$rows")) || exit 0 -[[ -n $name ]] || exit 0 +selection=$(omarchy-menu-select "${1^} plugin" <<<"$rows") || exit 0 +[[ -n $selection ]] || exit 0 -id=$(awk -F'\t' -v label="$name" '$2 == label { print $3; exit }' <<<"$rows") +id=$(cut -f2 <<<"$selection") [[ -n $id ]] || exit 1 if [[ $1 == "clone" ]]; then diff --git a/bin/omarchy-menu-select b/bin/omarchy-menu-select index 5a5dde55..1404665f 100755 --- a/bin/omarchy-menu-select +++ b/bin/omarchy-menu-select @@ -6,8 +6,11 @@ # omarchy:args=prompt [option...] [-- menu args...] # omarchy:examples=omarchy menu select Format jpg png|omarchy-menu-select Resolution 4k 1080p 720p -- --width 400 -# An option may lead with an icon, as "