From b50ec21442c4b1fd60bc8671646ddfd500fb2551 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 5 Mar 2026 14:16:50 -0400 Subject: [PATCH] Toggle existing omarchy menu if already open --- bin/omarchy-menu | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/omarchy-menu b/bin/omarchy-menu index c75d321c..ef083dae 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -19,6 +19,13 @@ back_to() { fi } +toggle_existing_menu() { + if pgrep -f "walker.*--dmenu" > /dev/null; then + walker --close > /dev/null 2>&1 + exit 0 + fi +} + menu() { local prompt="$1" local options="$2" @@ -619,6 +626,8 @@ go_to_menu() { USER_EXTENSIONS="$HOME/.config/omarchy/extensions/menu.sh" [[ -f $USER_EXTENSIONS ]] && source "$USER_EXTENSIONS" +toggle_existing_menu + if [[ -n $1 ]]; then BACK_TO_EXIT=true go_to_menu "$1"