Launch shell actions through Hyprland

This commit is contained in:
David Heinemeier Hansson
2026-05-26 18:50:24 +02:00
parent c70ed3cdcd
commit 9100bc96be
4 changed files with 14 additions and 3 deletions
@@ -4,4 +4,4 @@
# omarchy:args=<command>
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"
+11
View File
@@ -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)
}
+1 -1
View File
@@ -241,7 +241,7 @@ Item {
function run(command) {
if (!command) return
launcher.command = ["bash", "-lc", command]
launcher.command = Util.hyprExecCommand(command)
launcher.startDetached()
}
+1 -1
View File
@@ -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) {