diff options
Diffstat (limited to '.config/quickshell/Modules/Bar.qml')
| -rw-r--r-- | .config/quickshell/Modules/Bar.qml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/.config/quickshell/Modules/Bar.qml b/.config/quickshell/Modules/Bar.qml index 3120574..8ddd144 100644 --- a/.config/quickshell/Modules/Bar.qml +++ b/.config/quickshell/Modules/Bar.qml @@ -52,14 +52,18 @@ Variants { spacing: 6 Repeater { - model: ScriptModel { - values: Hyprland.workspaces.values.filter(ws => ws.id >= 0).sort((a, b) => a.id - b.id) - } + model: 10 delegate: Rectangle { - required property HyprlandWorkspace modelData - property bool focused: modelData.focused - property bool occupied: modelData.toplevels.values.length > 0 + property HyprlandWorkspace ws: { + Hyprland.workspaces.values.find(ws => ws.id === index + 1) || null + } + property bool focused: { + ws && ws.monitor.name === root.screen.name && ws.focused + } + property bool occupied: { + ws && ws.monitor.name === root.screen.name && ws.toplevels.values.length > 0 + } width: 20 height: 20 |
