qs: fix some manual hyprland dispatches

This commit is contained in:
end-4
2026-05-12 08:28:10 +02:00
parent 7dcbabcd8c
commit 807c761ed0
3 changed files with 7 additions and 7 deletions
@@ -76,7 +76,7 @@ Scope {
GlobalStates.screenLocked = false;
// Refocus last focused window on unlock (hack)
Quickshell.execDetached(["bash", "-c", `sleep 0.2; hyprctl --batch "dispatch togglespecialworkspace; dispatch togglespecialworkspace"`])
Quickshell.execDetached(["bash", "-c", `sleep 0.2; hyprctl dispatch 'hl.dsp.workspace.toggle_special("special")'; hyprctl dispatch 'hl.dsp.workspace.toggle_special("special")'`])
// Reset
lockContext.reset();
@@ -24,11 +24,11 @@ LockScreen {
var monName = Quickshell.screens[j].name
var wsId = root.savedWorkspaces[monName]
if (wsId !== undefined) {
batch += "dispatch focusmonitor " + monName + "; dispatch workspace " + wsId + "; "
batch += `hyprctl dispatch 'hl.dsp.focus({monitor="${monName}"})'; hyprctl dispatch 'hl.dsp.focus({workspace=${wsId}})';`
}
}
if (batch.length > 0) {
Quickshell.execDetached(["hyprctl", "--batch", batch + "reload"])
Quickshell.execDetached(["bash", "-c", batch])
}
}
}
@@ -53,10 +53,10 @@ LockScreen {
}
var ws = (mData?.activeWorkspace?.id ?? 1)
next[mon] = ws
batch += "dispatch focusmonitor " + mon + "; dispatch workspace " + (2147483647 - ws) + "; "
batch += `hyprctl dispatch 'hl.dsp.focus({monitor="${mon}"})'; hyprctl dispatch 'hl.dsp.focus({workspace=${2147483647 - ws}})';`
}
root.savedWorkspaces = next
Quickshell.execDetached(["hyprctl", "--batch", batch + "reload"])
Quickshell.execDetached(["bash", "-c", batch])
} else {
restoreTimer.start()
}
@@ -34,7 +34,7 @@ Scope { // Scope
running = true;
}
function doIt2(output) {
command = ["bash", "-c", "hyprctl dispatch movecursor 9999 9999"];
command = ["bash", "-c", "hyprctl dispatch 'hl.dsp.cursor.move({x=9999,y=9999})'"];
hook = () => {
doIt3();
}
@@ -42,7 +42,7 @@ Scope { // Scope
}
function doIt3(output) {
root.pin = !root.pin;
command = ["bash", "-c", `sleep 0.01; hyprctl dispatch movecursor ${cursorX} ${cursorY}`];
command = ["bash", "-c", `sleep 0.01; hyprctl dispatch 'hl.dsp.cursor.move({x=${cursorX},y=${cursorY}})'`];
hook = null
running = true;
}