Launch shell actions through Hyprland
This commit is contained in:
@@ -4,4 +4,4 @@
|
|||||||
# omarchy:args=<command>
|
# omarchy:args=<command>
|
||||||
|
|
||||||
cmd="$*"
|
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"
|
||||||
|
|||||||
@@ -38,6 +38,17 @@ QtObject {
|
|||||||
return "'" + String(value || "").replace(/'/g, "'\\''") + "'"
|
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) {
|
function isPlainObject(value) {
|
||||||
return value !== null && typeof value === "object" && !Array.isArray(value)
|
return value !== null && typeof value === "object" && !Array.isArray(value)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ Item {
|
|||||||
function run(command) {
|
function run(command) {
|
||||||
if (!command) return
|
if (!command) return
|
||||||
|
|
||||||
launcher.command = ["bash", "-lc", command]
|
launcher.command = Util.hyprExecCommand(command)
|
||||||
launcher.startDetached()
|
launcher.startDetached()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ Item {
|
|||||||
var command = String(action || "")
|
var command = String(action || "")
|
||||||
if (!command) return
|
if (!command) return
|
||||||
|
|
||||||
Quickshell.execDetached(["bash", "-lc", command])
|
Quickshell.execDetached(Util.hyprExecCommand(command))
|
||||||
}
|
}
|
||||||
|
|
||||||
function rowHeightForDetail(detail) {
|
function rowHeightForDetail(detail) {
|
||||||
|
|||||||
Reference in New Issue
Block a user