quickshell: server glance bars -> numbers

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-07-28 15:54:24 +01:00
parent 01b771b17d
commit 39b88591e8

View file

@ -1567,30 +1567,24 @@ in
});
}
// Numbers, colour-coded instead of labelled:
// blue = cpu%, cyan = ram%, grey = ping ms.
Column {
anchors.centerIn: parent
spacing: 4
spacing: 2
Rectangle {
width: 24; height: 3; radius: 1.5
color: Theme.base02
Rectangle {
width: srvWidget.connected ? Math.max(2, parent.width * Math.min(1, srvWidget.cpu / 100)) : 0
height: parent.height; radius: parent.radius
color: Theme.base0D
Behavior on width { NumberAnimation { duration: 300 } }
}
SText {
anchors.horizontalCenter: parent.horizontalCenter
text: srvWidget.connected ? Math.round(srvWidget.cpu) + "%" : "--"
font.pixelSize: 9
color: srvWidget.connected ? Theme.base0D : Theme.base03
}
Rectangle {
width: 24; height: 3; radius: 1.5
color: Theme.base02
Rectangle {
width: srvWidget.connected && srvWidget.memTotal > 0
? Math.max(2, parent.width * Math.min(1, srvWidget.memUsed / srvWidget.memTotal)) : 0
height: parent.height; radius: parent.radius
color: Theme.base0C
Behavior on width { NumberAnimation { duration: 300 } }
}
SText {
anchors.horizontalCenter: parent.horizontalCenter
text: srvWidget.connected && srvWidget.memTotal > 0
? Math.round(100 * srvWidget.memUsed / srvWidget.memTotal) + "%" : "--"
font.pixelSize: 9
color: srvWidget.connected ? Theme.base0C : Theme.base03
}
SText {
anchors.horizontalCenter: parent.horizontalCenter