summaryrefslogtreecommitdiff
path: root/.config/quickshell/Modules/BarWorkspaces.qml
diff options
context:
space:
mode:
Diffstat (limited to '.config/quickshell/Modules/BarWorkspaces.qml')
-rw-r--r--.config/quickshell/Modules/BarWorkspaces.qml48
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
+ }
+ }
+ }
+}