hyprland: fix active workspace

This commit is contained in:
2 * r + 2 * t 2025-04-29 15:43:19 +10:00
parent a33cd21fc7
commit 435f077f98

View file

@ -12,7 +12,7 @@ Singleton {
readonly property var workspaces: Hyprland.workspaces
readonly property var monitors: Hyprland.monitors
property var activeClient: null
property HyprlandWorkspace activeWorkspace: null
property HyprlandWorkspace activeWorkspace: focusedMonitor?.activeWorkspace ?? null
property HyprlandMonitor focusedMonitor: Hyprland.monitors.values.find(m => m.lastIpcObject.focused) ?? null
function reload() {
@ -20,7 +20,6 @@ Singleton {
Hyprland.refreshMonitors();
getClients.running = true;
getActiveClient.running = true;
getActiveWorkspace.running = true;
}
function dispatch(request: string): void {
@ -72,15 +71,4 @@ Singleton {
}
}
}
Process {
id: getActiveWorkspace
command: ["bash", "-c", "hyprctl -j activeworkspace | jq -c"]
stdout: SplitParser {
onRead: data => {
const ws = JSON.parse(data);
root.activeWorkspace = root.workspaces.values.find(w => w.id === ws.id) ?? null;
}
}
}
}