Files
nixos-config/home/common/programs/hyprland/quickshell/Workspaces.qml
T
Miguel Palhas e8086e8528 Several hyprland updates:
plugins, new cursor, light/dark themes, new app launcher, ...
2026-02-16 17:33:40 +00:00

42 lines
1013 B
QML

import QtQuick
import QtQuick.Layouts
import Quickshell.Hyprland
RowLayout {
spacing: 4
Repeater {
model: [1, 2, 3, 4, 5, 6]
Rectangle {
required property int modelData
property bool active: Hyprland.focusedMonitor?.activeWorkspace?.id === modelData
property bool occupied: {
for (let i = 0; i < Hyprland.workspaces.values.length; i++) {
let ws = Hyprland.workspaces.values[i];
if (ws.id === modelData && ws.windows > 0) return true;
}
return false;
}
Layout.preferredWidth: 24
Layout.preferredHeight: 24
radius: 4
color: active ? "#b4befe" : "transparent"
Text {
anchors.centerIn: parent
text: modelData
font.family: "FiraCode Nerd Font"
font.pixelSize: 13
color: active ? "#11111b" : occupied ? "#bac2de" : "#6c7086"
}
MouseArea {
anchors.fill: parent
onClicked: Hyprland.dispatch("workspace " + modelData)
}
}
}
}