From 3d300067f6e179e03d1983159b81e1c2cfe2fa8c Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Fri, 16 Jan 2026 11:04:25 -0500 Subject: refactor qs bar --- .config/quickshell/Modules/BarWorkspaces.qml | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .config/quickshell/Modules/BarWorkspaces.qml (limited to '.config/quickshell/Modules/BarWorkspaces.qml') diff --git a/.config/quickshell/Modules/BarWorkspaces.qml b/.config/quickshell/Modules/BarWorkspaces.qml new file mode 100644 index 0000000..fa95262 --- /dev/null +++ b/.config/quickshell/Modules/BarWorkspaces.qml @@ -0,0 +1,48 @@ +import Quickshell +import Quickshell.Hyprland +import QtQuick +import qs.Services + +Rectangle { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + implicitWidth: workspaces.implicitWidth + 12*2 + height: parent.height + color: Flexoki.bg + radius: 18 + + Row { + id: workspaces + anchors.centerIn: parent + height: 20 + spacing: 6 + + Repeater { + model: 10 + + delegate: Rectangle { + property HyprlandWorkspace ws: { + Hyprland.workspaces.values.find(ws => ws.id === index + 1) || null + } + property bool focused: { + ws && ws.monitor && ws.monitor.name === root.screen.name && ws.focused + } + property bool occupied: { + ws && ws.monitor && ws.monitor.name === root.screen.name && ws.toplevels.values.length > 0 + } + + width: 20 + height: 20 + radius: 10 + + color: { + if (!focused) return "transparent" + return occupied ? Flexoki.re : Flexoki.ui3 + } + + border.width: 2 + border.color: occupied ? Flexoki.re : Flexoki.ui3 + } + } + } +} -- cgit v1.2.3