Launch shell commands on active workspace

This commit is contained in:
David Heinemeier Hansson
2026-06-29 11:26:23 -05:00
parent 4ab3377950
commit 987588f512
7 changed files with 114 additions and 58 deletions
+4 -8
View File
@@ -1,4 +1,5 @@
pragma Singleton
import Quickshell
import QtQuick
// Shared utility helpers used across plugins. Pure functions only — no
@@ -6,6 +7,8 @@ import QtQuick
QtObject {
id: root
readonly property string omarchyPath: Quickshell.env("OMARCHY_PATH")
function clamp(value, min, max) {
var n = Number(value)
if (!isFinite(n)) return min
@@ -38,15 +41,8 @@ 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) + ")"]
return [omarchyPath + "/bin/omarchy-hyprland-launch", command]
}
function isPlainObject(value) {