mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Show cores usage in tooltip if enabled
This commit is contained in:
@@ -1761,6 +1761,7 @@
|
||||
"system-monitor": {
|
||||
"cpu-temp": "CPU temp",
|
||||
"cpu-usage": "CPU usage",
|
||||
"core-usage": "Core {id} usage",
|
||||
"disk": "Disk",
|
||||
"download-speed": "Download speed",
|
||||
"gpu-temp": "GPU temp",
|
||||
|
||||
@@ -47,6 +47,7 @@ Item {
|
||||
readonly property bool usePadding: !compactMode && !isVertical && useMonospaceFont && ((widgetSettings.usePadding !== undefined) ? widgetSettings.usePadding : widgetMetadata.usePadding)
|
||||
|
||||
readonly property bool showCpuUsage: (widgetSettings.showCpuUsage !== undefined) ? widgetSettings.showCpuUsage : widgetMetadata.showCpuUsage
|
||||
readonly property bool showCpuCores: (widgetSettings.showCpuCores !== undefined) ? widgetSettings.showCpuCores : widgetMetadata.showCpuCores
|
||||
readonly property bool showCpuFreq: (widgetSettings.showCpuFreq !== undefined) ? widgetSettings.showCpuFreq : widgetMetadata.showCpuFreq
|
||||
readonly property bool showCpuTemp: (widgetSettings.showCpuTemp !== undefined) ? widgetSettings.showCpuTemp : widgetMetadata.showCpuTemp
|
||||
readonly property bool showGpuTemp: (widgetSettings.showGpuTemp !== undefined) ? widgetSettings.showGpuTemp : widgetMetadata.showGpuTemp
|
||||
@@ -94,6 +95,11 @@ Item {
|
||||
|
||||
// CPU
|
||||
rows.push([I18n.tr("system-monitor.cpu-usage"), `${Math.round(SystemStatService.cpuUsage)}% (${SystemStatService.cpuFreq.replace(/[^0-9.]/g, "")} GHz)`]);
|
||||
if (showCpuCores) {
|
||||
SystemStatService.coresUsage.forEach((usage, core) => rows.push([" " + I18n.tr("system-monitor.core-usage", {
|
||||
"id": core
|
||||
}), `${Math.round(usage)}%`]));
|
||||
}
|
||||
|
||||
if (SystemStatService.cpuTemp > 0) {
|
||||
rows.push([I18n.tr("system-monitor.cpu-temp"), `${Math.round(SystemStatService.cpuTemp)}°C`]);
|
||||
|
||||
Reference in New Issue
Block a user