Watch
1
0
Fork
You've already forked souveraine
0

quickshell: pin shared ii base and phone overlay

This commit is contained in:
Fimeg 2026-07-21 18:55:02 -04:00
commit b0a1304ba1
970 changed files with 88310 additions and 1 deletions

View file

@ -0,0 +1,57 @@
pragma Singleton
import qs.modules.common
import qs.modules.common.functions
import Quickshell
import Quickshell.Io
Singleton {
id: root
signal keyPressed(int keycode)
signal keyReleased(int keycode)
property bool active: false
onActiveChanged: {
if (active) {
monitor.running = true;
} else {
monitor.running = false;
}
}
Process {
id: monitor
command: ["python3", `${Directories.scriptPath}/keyboard_monitor.py`]
stdout: SplitParser {
onRead: data => {
try {
const event = JSON.parse(data);
if (event.error) {
console.warn("[PhysicalKeyboard]", event.error);
return;
}
if (event.status === "ready") {
return;
}
if (event.keycode !== undefined) {
if (event.pressed) {
root.keyPressed(event.keycode);
} else {
root.keyReleased(event.keycode);
}
}
} catch (e) {
console.warn("[PhysicalKeyboard] Parse error:", e);
}
}
}
onExited: (exitCode, exitStatus) => {
if (root.active) {
console.warn("[PhysicalKeyboard] Monitor exited unexpectedly with code", exitCode, "- restarting");
monitor.running = true;
}
}
}
}