Extract launch_sole

This commit is contained in:
David Heinemeier Hansson
2026-05-14 12:58:39 +02:00
parent 8f237f1858
commit a4e4b4b1ed
2 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -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 + ALT + M", "Music TUI", "omarchy-launch-or-focus-tui cliamp")
o.bind("SUPER + SHIFT + N", "Editor", "omarchy-launch-editor") o.bind("SUPER + SHIFT + N", "Editor", "omarchy-launch-editor")
o.bind("SUPER + SHIFT + D", "Docker", "omarchy-launch-tui lazydocker") 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_sole("SUPER + SHIFT + G", "Signal", "^signal$", "signal-desktop")
o.bind("SUPER + SHIFT + O", "Obsidian", [[omarchy-launch-or-focus ^obsidian$ "]] .. o.launch("obsidian") .. [["]]) 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 + W", "Typora", "typora --enable-wayland-ime")
o.bind_launch("SUPER + SHIFT + SLASH", "Passwords", "1password") o.bind_launch("SUPER + SHIFT + SLASH", "Passwords", "1password")
+8
View File
@@ -50,6 +50,14 @@ function o.bind_webapp(keys, description, url, options)
o.bind(keys, description, o.launch_webapp(url), options) o.bind(keys, description, o.launch_webapp(url), options)
end 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) function o.bind_webapp_sole(keys, description, url, options)
o.bind(keys, description, o.launch_webapp_sole(description, url), options) o.bind(keys, description, o.launch_webapp_sole(description, url), options)
end end