From 9100bc96be6a3b27240e23b24429cc7a889e367a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 26 May 2026 17:20:14 +0200 Subject: [PATCH] Launch shell actions through Hyprland --- ...omarchy-launch-floating-terminal-with-presentation | 2 +- shell/Commons/Util.qml | 11 +++++++++++ shell/plugins/bar/Bar.qml | 2 +- shell/plugins/menu/Menu.qml | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-launch-floating-terminal-with-presentation b/bin/omarchy-launch-floating-terminal-with-presentation index f342087d..b0eaee72 100755 --- a/bin/omarchy-launch-floating-terminal-with-presentation +++ b/bin/omarchy-launch-floating-terminal-with-presentation @@ -4,4 +4,4 @@ # omarchy:args= cmd="$*" -exec env -u NO_COLOR setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.terminal --title=Omarchy -e bash -c "omarchy-show-logo; $cmd; if (( \$? != 130 )); then omarchy-show-done; fi" +exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.terminal --title=Omarchy -e bash -c "omarchy-show-logo; $cmd; if (( \$? != 130 )); then omarchy-show-done; fi" diff --git a/shell/Commons/Util.qml b/shell/Commons/Util.qml index 9ad90351..2927176f 100644 --- a/shell/Commons/Util.qml +++ b/shell/Commons/Util.qml @@ -38,6 +38,17 @@ QtObject { return "'" + String(value || "").replace(/'/g, "'\\''") + "'" } + function luaQuote(value) { + return "\"" + String(value || "") + .replace(/\\/g, "\\\\") + .replace(/"/g, "\\\"") + .replace(/\n/g, "\\n") + "\"" + } + + function hyprExecCommand(command) { + return ["hyprctl", "dispatch", "hl.dsp.exec_cmd(" + luaQuote(command) + ")"] + } + function isPlainObject(value) { return value !== null && typeof value === "object" && !Array.isArray(value) } diff --git a/shell/plugins/bar/Bar.qml b/shell/plugins/bar/Bar.qml index d75f022d..bef7d58c 100644 --- a/shell/plugins/bar/Bar.qml +++ b/shell/plugins/bar/Bar.qml @@ -241,7 +241,7 @@ Item { function run(command) { if (!command) return - launcher.command = ["bash", "-lc", command] + launcher.command = Util.hyprExecCommand(command) launcher.startDetached() } diff --git a/shell/plugins/menu/Menu.qml b/shell/plugins/menu/Menu.qml index ebe29f51..49b0910e 100644 --- a/shell/plugins/menu/Menu.qml +++ b/shell/plugins/menu/Menu.qml @@ -120,7 +120,7 @@ Item { var command = String(action || "") if (!command) return - Quickshell.execDetached(["bash", "-lc", command]) + Quickshell.execDetached(Util.hyprExecCommand(command)) } function rowHeightForDetail(detail) {