aboutsummaryrefslogtreecommitdiffstats
path: root/home/quickshell/bar/blocks/Workspaces.qml
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2024-05-23 13:56:00 +0300
committerPetri Hienonen <petri.hienonen@gmail.com>2025-11-30 12:29:57 +0200
commit08297376a85a1719518507e54fca9de954d2376a (patch)
tree3b9c58304b40248533bbb2bb5b7bad2da9da1ff0 /home/quickshell/bar/blocks/Workspaces.qml
parent75c2af4aedd2ac5c2cfc74b346625fa4b265541d (diff)
downloadnixos-08297376a85a1719518507e54fca9de954d2376a.tar.zst
Agenix configuration
Diffstat (limited to 'home/quickshell/bar/blocks/Workspaces.qml')
-rw-r--r--home/quickshell/bar/blocks/Workspaces.qml74
1 files changed, 74 insertions, 0 deletions
diff --git a/home/quickshell/bar/blocks/Workspaces.qml b/home/quickshell/bar/blocks/Workspaces.qml
new file mode 100644
index 0000000..66d48a6
--- /dev/null
+++ b/home/quickshell/bar/blocks/Workspaces.qml
@@ -0,0 +1,74 @@
+import QtQuick
+import QtQuick.Layouts
+import Quickshell
+import Quickshell.Hyprland
+import Quickshell.Widgets
+import Qt5Compat.GraphicalEffects
+import "../utils" as Utils
+import "root:/"
+
+RowLayout {
+ property HyprlandMonitor monitor: Hyprland.monitorFor(screen)
+
+ Rectangle {
+ id: workspaceBar
+ Layout.preferredWidth: Math.max(50, Utils.HyprlandUtils.maxWorkspace * 25)
+ Layout.preferredHeight: 23
+ radius: 7
+ color: Theme.get.barBgColor
+
+ Row {
+ anchors.centerIn: parent
+ spacing: 15
+
+ Repeater {
+ model: Utils.HyprlandUtils.maxWorkspace || 1
+
+ Item {
+ required property int index
+ property bool focused: Hyprland.focusedMonitor?.activeWorkspace?.id === (index + 1)
+
+ width: workspaceText.width
+ height: workspaceText.height
+
+ Text {
+ id: workspaceText
+ text: (index + 1).toString()
+ color: "white"
+ font.pixelSize: 15
+ font.bold: focused
+ }
+
+ Rectangle {
+ visible: focused
+ anchors {
+ left: workspaceText.left
+ right: workspaceText.right
+ top: workspaceText.bottom
+ topMargin: -3
+ }
+ height: 2
+ color: "white"
+ }
+
+ DropShadow {
+ visible: focused
+ anchors.fill: workspaceText
+ horizontalOffset: 2
+ verticalOffset: 2
+ radius: 8.0
+ samples: 20
+ color: "#000000"
+ source: workspaceText
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: Utils.HyprlandUtils.switchWorkspace(index + 1)
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file