extract cpu service from system stats, add --types filter to nova-stats

This commit is contained in:
Damocles 2026-04-27 19:04:28 +02:00
parent 8628b4b27b
commit 29e06eadb5
7 changed files with 227 additions and 189 deletions

View file

@ -8,25 +8,18 @@ M.BarModule {
id: root
active: S.Modules.cpu.enable
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
tooltip: "CPU: " + S.SystemStats.cpuUsage + "% @ " + S.SystemStats.cpuFreqGhz.toFixed(2) + " GHz"
tooltip: "CPU: " + S.CpuService.usage + "% @ " + S.CpuService.freqGhz.toFixed(2) + " GHz"
panelNamespace: "nova-cpu"
panelContentWidth: 260
panelComponent: Component {
C.CpuApplet {
width: parent.width
cores: root._cores
coreMaxFreq: root._coreMaxFreq
coreTypes: root._coreTypes
processes: root._procs.processes
accentColor: root.accentColor
active: root._showPanel
}
}
readonly property var _cores: S.SystemStats.cpuCores
readonly property var _coreMaxFreq: S.SystemStats.cpuCoreMaxFreq
readonly property var _coreTypes: S.SystemStats.cpuCoreTypes
property M.ProcessList _procs: M.ProcessList {
sortBy: "cpu"
active: root._showPanel
@ -38,7 +31,7 @@ M.BarModule {
anchors.verticalCenter: parent.verticalCenter
}
M.BarLabel {
label: S.SystemStats.cpuUsage.toString().padStart(2) + "%@" + S.SystemStats.cpuFreqGhz.toFixed(2)
label: S.CpuService.usage.toString().padStart(2) + "%@" + S.CpuService.freqGhz.toFixed(2)
minText: "99%@9.99"
anchors.verticalCenter: parent.verticalCenter
}