From a4e4b4b1ed2975fd141ffd7bc7533e00e0a3b787 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 14 May 2026 12:58:39 +0200 Subject: [PATCH] Extract launch_sole --- config/hypr/bindings.lua | 4 ++-- default/hypr/helpers.lua | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/hypr/bindings.lua b/config/hypr/bindings.lua index df3a9f95..19b8e948 100644 --- a/config/hypr/bindings.lua +++ b/config/hypr/bindings.lua @@ -10,8 +10,8 @@ o.bind("SUPER + SHIFT + M", "Music", "omarchy-launch-or-focus spotify") o.bind("SUPER + SHIFT + ALT + M", "Music TUI", "omarchy-launch-or-focus-tui cliamp") o.bind("SUPER + SHIFT + N", "Editor", "omarchy-launch-editor") o.bind("SUPER + SHIFT + D", "Docker", "omarchy-launch-tui lazydocker") -o.bind("SUPER + SHIFT + G", "Signal", [[omarchy-launch-or-focus ^signal$ "]] .. o.launch("signal-desktop") .. [["]]) -o.bind("SUPER + SHIFT + O", "Obsidian", [[omarchy-launch-or-focus ^obsidian$ "]] .. o.launch("obsidian") .. [["]]) +o.bind_sole("SUPER + SHIFT + G", "Signal", "^signal$", "signal-desktop") +o.bind_sole("SUPER + SHIFT + O", "Obsidian", "^obsidian$", "obsidian") o.bind_launch("SUPER + SHIFT + W", "Typora", "typora --enable-wayland-ime") o.bind_launch("SUPER + SHIFT + SLASH", "Passwords", "1password") diff --git a/default/hypr/helpers.lua b/default/hypr/helpers.lua index ba570ca2..dd67ed90 100644 --- a/default/hypr/helpers.lua +++ b/default/hypr/helpers.lua @@ -50,6 +50,14 @@ function o.bind_webapp(keys, description, url, options) o.bind(keys, description, o.launch_webapp(url), options) end +function o.launch_sole(match, command) + return "omarchy-launch-or-focus " .. shell_quote(match) .. " " .. shell_quote(o.launch(command)) +end + +function o.bind_sole(keys, description, match, command, options) + o.bind(keys, description, o.launch_sole(match, command), options) +end + function o.bind_webapp_sole(keys, description, url, options) o.bind(keys, description, o.launch_webapp_sole(description, url), options) end