45 lines
1.3 KiB
QML
45 lines
1.3 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import "." as M
|
|
import "../services" as S
|
|
import "../applets" as C
|
|
|
|
M.BarModule {
|
|
id: root
|
|
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
|
tooltip: "CPU: " + S.SystemStats.cpuUsage + "% @ " + S.SystemStats.cpuFreqGhz.toFixed(2) + " GHz"
|
|
panelNamespace: "nova-cpu"
|
|
panelTitle: "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
|
|
onProcessesChanged: root.keepPanelOpen(300)
|
|
}
|
|
|
|
M.BarIcon {
|
|
icon: "\uF2DB"
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
M.BarLabel {
|
|
label: S.SystemStats.cpuUsage.toString().padStart(2) + "%@" + S.SystemStats.cpuFreqGhz.toFixed(2)
|
|
minText: "99%@9.99"
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
}
|