feat(quickshell): support x11 bar sessions

This commit is contained in:
2026-09-27 09:33:47 -04:00
parent 3f6473ce17
commit 5c13c8c3e7
10 changed files with 133 additions and 24 deletions
@@ -0,0 +1,40 @@
import QtQuick
import Quickshell.I3
import Quickshell.Io
Text {
id: root
function focusedTitle(node) {
for (const child of (node.nodes || []).concat(node.floating_nodes || [])) {
const title = focusedTitle(child);
if (title)
return title;
}
return node.focused && node.type === "con" ? node.name || "" : "";
}
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
color: Theme.foreground
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSize
Connections {
target: I3
function onRawEvent(event) {
if ((event.type === "window" || event.type === "workspace") && !treeQuery.running)
treeQuery.running = true;
}
}
Process {
id: treeQuery
command: ["i3-msg", "-t", "get_tree"]
running: true
stdout: StdioCollector {
onStreamFinished: root.text = root.focusedTitle(JSON.parse(text))
}
}
}