quickshell: glance gets cpu/ram captions, ms under ping
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
ee86678cb5
commit
bf1ed23d4f
1 changed files with 54 additions and 22 deletions
|
|
@ -1827,37 +1827,69 @@ in
|
|||
});
|
||||
}
|
||||
|
||||
// Numbers, colour-coded instead of labelled:
|
||||
// blue = cpu%, cyan = ram%, grey = ping ms.
|
||||
// Same 15px Medium as the clock above.
|
||||
// Labelled numbers, 15px Medium like the clock:
|
||||
// "cpu"/"ram" captions above their values, faded "ms"
|
||||
// under the ping.
|
||||
Column {
|
||||
id: srvGlanceCol
|
||||
anchors.centerIn: parent
|
||||
spacing: 0
|
||||
spacing: 5
|
||||
|
||||
SText {
|
||||
Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: srvWidget.connected ? Math.round(srvWidget.cpu) + "%" : "--"
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: srvWidget.connected ? Theme.base0D : Theme.base03
|
||||
spacing: 0
|
||||
SText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "cpu"
|
||||
font.pixelSize: 9
|
||||
color: Theme.base03
|
||||
}
|
||||
SText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: srvWidget.connected ? Math.round(srvWidget.cpu) + "%" : "--"
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: srvWidget.connected ? Theme.base0D : Theme.base03
|
||||
}
|
||||
}
|
||||
SText {
|
||||
|
||||
Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: srvWidget.connected && srvWidget.memTotal > 0
|
||||
? Math.round(100 * srvWidget.memUsed / srvWidget.memTotal) + "%" : "--"
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: srvWidget.connected ? Theme.base0C : Theme.base03
|
||||
spacing: 0
|
||||
SText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "ram"
|
||||
font.pixelSize: 9
|
||||
color: Theme.base03
|
||||
}
|
||||
SText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: srvWidget.connected && srvWidget.memTotal > 0
|
||||
? Math.round(100 * srvWidget.memUsed / srvWidget.memTotal) + "%" : "--"
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: srvWidget.connected ? Theme.base0C : Theme.base03
|
||||
}
|
||||
}
|
||||
SText {
|
||||
|
||||
Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: srvWidget.pingMs < 0 ? "--"
|
||||
: srvWidget.pingMs < 10 ? srvWidget.pingMs.toFixed(1)
|
||||
: Math.round(srvWidget.pingMs).toString()
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: srvWidget.pingMs < 0 ? Theme.base03 : Theme.base04
|
||||
spacing: 0
|
||||
SText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: srvWidget.pingMs < 0 ? "--"
|
||||
: srvWidget.pingMs < 10 ? srvWidget.pingMs.toFixed(1)
|
||||
: Math.round(srvWidget.pingMs).toString()
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: srvWidget.pingMs < 0 ? Theme.base03 : Theme.base04
|
||||
}
|
||||
SText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "ms"
|
||||
font.pixelSize: 9
|
||||
color: Theme.base03
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue