This repository has been archived on 2026-11-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
dotfiles/mutable_config/quickshell/components/Workspaces.qml
T
2026-08-23 20:20:02 +02:00

44 lines
1.1 KiB
QML

import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Hyprland
import "../core"
RowLayout {
id: root
spacing: 4
property var monitor: null
Repeater {
model: Hyprland.workspaces
delegate: Rectangle {
property var ws: modelData
// Only show workspaces belonging to the specific monitor
visible: root.monitor === null || (ws.monitor && ws.monitor.name === root.monitor.name)
width: visible ? 28 : 0
height: visible ? 28 : 0
radius: Theme.radius / 2
// Highlight if active
color: ws.isActive ? Theme.primary : Theme.bgAlt
Text {
anchors.centerIn: parent
text: ws.id
color: ws.isActive ? Theme.bg : Theme.fg
font: Theme.fontBold
}
MouseArea {
anchors.fill: parent
onClicked: Hyprland.dispatch("workspace", ws.id)
cursorShape: Qt.PointingHandCursor
}
}
}
}