Bar: SysMon
This commit is contained in:
parent
53901f2c9f
commit
b53cc0466d
4 changed files with 100 additions and 14 deletions
|
|
@ -50,11 +50,14 @@ Variants {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.marginSmall * scaling
|
||||
|
||||
NText {
|
||||
text: screen.name
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.weight: Style.fontWeightBold
|
||||
}
|
||||
// Debug show monitor name
|
||||
// NText {
|
||||
// text: screen.name
|
||||
// anchors.verticalCenter: parent.verticalCenter
|
||||
// font.weight: Style.fontWeightBold
|
||||
// }
|
||||
|
||||
SystemMonitor {}
|
||||
}
|
||||
|
||||
// Center
|
||||
|
|
|
|||
84
Modules/Bar/SystemMonitor.qml
Normal file
84
Modules/Bar/SystemMonitor.qml
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Row {
|
||||
id: layout
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.marginSmall * scaling
|
||||
visible: Settings.data.bar.showSystemInfo
|
||||
|
||||
// Ensure our width is an integer
|
||||
width: Math.floor(cpuUsageLayout.width + cpuTempLayout.width + memoryUsageLayout.width + (2 * 10))
|
||||
|
||||
Row {
|
||||
id: cpuUsageLayout
|
||||
spacing: Style.marginTiny * scaling
|
||||
|
||||
NText {
|
||||
id: cpuUsageIcon
|
||||
text: "speed"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pointSize: Style.fontSizeLarge * scaling
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: Colors.accentPrimary
|
||||
}
|
||||
|
||||
NText {
|
||||
id: cpuUsageText
|
||||
text: `${SystemStats.cpuUsage}%`
|
||||
font.pointSize: Style.fontSizeSmall * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
// CPU Temperature Component
|
||||
Row {
|
||||
id: cpuTempLayout
|
||||
spacing: Style.marginTiny * scaling
|
||||
|
||||
NText {
|
||||
text: "thermometer"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pointSize: Style.fontSizeLarge * scaling
|
||||
color: Colors.accentPrimary
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
NText {
|
||||
text: `${SystemStats.cpuTemp}°C`
|
||||
font.pointSize: Style.fontSizeSmall * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
// Memory Usage Component
|
||||
Row {
|
||||
id: memoryUsageLayout
|
||||
spacing: Style.marginTiny * scaling
|
||||
|
||||
NText {
|
||||
text: "memory"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pointSize: Style.fontSizeLarge * scaling
|
||||
color: Colors.accentPrimary
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
NText {
|
||||
text: `${SystemStats.memoryUsageGb}G`
|
||||
font.pointSize: Style.fontSizeSmall * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue