Launch shell commands on active workspace
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user