quickshell: switch from hyprland dispatch exec trick to quickshell execdetached

This commit is contained in:
end-4
2025-06-21 02:51:21 +02:00
parent 29c7031bb2
commit e4be9852a3
21 changed files with 75 additions and 63 deletions
+20 -7
View File
@@ -20,23 +20,36 @@ Singleton {
function releaseAllKeys() {
const keycodes = Array.from(Array(249).keys());
const releaseCommand = `ydotool key --key-delay 0 ${keycodes.map(keycode => `${keycode}:0`).join(" ")}`
Hyprland.dispatch(`exec ${releaseCommand}`)
Quickshell.execDetached([
"ydotool",
"key", "--key-delay", "0",
...keycodes.map(keycode => `${keycode}:0`)
])
root.shiftMode = 0; // Reset shift mode
}
function releaseShiftKeys() {
const releaseCommand = `ydotool key --key-delay 0 ${root.shiftKeys.map(keycode => `${keycode}:0`).join(" ")}`
Hyprland.dispatch(`exec ${releaseCommand}`)
Quickshell.execDetached([
"ydotool",
"key", "--key-delay", "0",
...root.shiftKeys.map(keycode => `${keycode}:0`)
])
root.shiftMode = 0; // Reset shift mode
}
function press(keycode) {
Hyprland.dispatch(`exec ydotool key --key-delay 0 ${keycode}:1`);
Quickshell.execDetached([
"ydotool",
"key", "--key-delay", "0",
`${keycode}:1`
]);
}
function release(keycode) {
Hyprland.dispatch(`exec ydotool key --key-delay 0 ${keycode}:0`);
Quickshell.execDetached([
"ydotool",
"key", "--key-delay", "0",
`${keycode}:0`
]);
}
}