bar: fix kb layout

Closes #295
This commit is contained in:
2 * r + 2 * t 2025-07-29 12:43:31 +10:00
parent f171ca2c47
commit 067b71bcbd

View file

@ -30,7 +30,7 @@ Singleton {
return;
if (n === "activelayout") {
kbProc.running = true;
root.kbLayout = event.parse(2)[1].slice(0, 2).toLowerCase();
} else if (["workspace", "moveworkspace", "activespecial", "focusedmon"].includes(n)) {
Hyprland.refreshWorkspaces();
Hyprland.refreshMonitors();
@ -48,12 +48,10 @@ Singleton {
}
Process {
id: kbProc
running: true
command: ["hyprctl", "-j", "devices"]
stdout: StdioCollector {
onStreamFinished: root.kbLayout = JSON.parse(text).keyboards.find(k => k.main).layout
onStreamFinished: root.kbLayout = JSON.parse(text).keyboards.find(k => k.main).active_keymap.slice(0, 2).toLowerCase()
}
}
}