diff options
| author | Sam Nystrom <sam@samnystrom.dev> | 2026-01-16 11:04:25 -0500 |
|---|---|---|
| committer | Sam Nystrom <sam@samnystrom.dev> | 2026-01-16 11:06:33 -0500 |
| commit | 3d300067f6e179e03d1983159b81e1c2cfe2fa8c (patch) | |
| tree | 46981a14c530b6a1e897300372cefe83e0f491fe /.config/quickshell/Modules/BarWorkspaces.qml | |
| parent | edf72cc5f6f005251ef77d585bdf800891866d8a (diff) | |
refactor qs bar
Diffstat (limited to '.config/quickshell/Modules/BarWorkspaces.qml')
| -rw-r--r-- | .config/quickshell/Modules/BarWorkspaces.qml | 48 |
1 files changed, 48 insertions, 0 deletions
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 + } + } + } +} |
