From 2ae5aa90c94a1b5e12cd662325047e648fbe3d69 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Mon, 17 Nov 2025 14:29:32 -0500 Subject: [PATCH] BarSysMon: you can now select which disk mount point to monitor storage. --- Assets/Translations/de.json | 12 +++++++---- Assets/Translations/en.json | 12 +++++++---- Assets/Translations/es.json | 12 +++++++---- Assets/Translations/fr.json | 12 +++++++---- Assets/Translations/nl.json | 12 +++++++---- Assets/Translations/pt.json | 12 +++++++---- Assets/Translations/ru.json | 12 +++++++---- Assets/Translations/tr.json | 12 +++++++---- Assets/Translations/uk-UA.json | 12 +++++++---- Assets/Translations/zh-CN.json | 12 +++++++---- Modules/Bar/Widgets/SystemMonitor.qml | 7 ++++--- .../WidgetSettings/SystemMonitorSettings.qml | 20 +++++++++++++++++++ Services/UI/BarWidgetRegistry.qml | 3 ++- 13 files changed, 106 insertions(+), 44 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 59aafe49..3bbbf84f 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Storage Space (Critical)" }, + "disk-path": { + "description": "Wählen Sie den Festplatten-Mountpunkt aus, der überwacht werden soll.", + "label": "Festplattenpfad" + }, "disk-warning-threshold": { "label": "Storage Space (Warning)" }, @@ -789,6 +793,10 @@ "description": "Hintergrund-Transparenz der Statusleiste anpassen.", "label": "Hintergrund-Transparenz" }, + "capsule-opacity": { + "description": "Deckkraft der Widget-Hintergründe festlegen, wenn Kapsel angezeigt wird.", + "label": "Kapsel-Deckkraft" + }, "density": { "description": "Innenabstand der Statusleiste für kompaktes oder geräumiges Aussehen anpassen.", "label": "Statusleistendichte" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Widget-Hintergründe anzeigen.", "label": "Kapsel anzeigen" - }, - "capsule-opacity": { - "description": "Deckkraft der Widget-Hintergründe festlegen, wenn Kapsel angezeigt wird.", - "label": "Kapsel-Deckkraft" } }, "monitors": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 3b1aee6e..c21b19e1 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Storage Space (Critical)" }, + "disk-path": { + "description": "Select which disk mount point to monitor.", + "label": "Disk path" + }, "disk-warning-threshold": { "label": "Storage Space (Warning)" }, @@ -789,6 +793,10 @@ "description": "Adjust the background opacity of the bar.", "label": "Background opacity" }, + "capsule-opacity": { + "description": "Set the opacity level for widget backgrounds when capsule is shown.", + "label": "Capsule opacity" + }, "density": { "description": "Adjust the bar's padding for a compact or spacious look.", "label": "Bar density" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Show widget backgrounds.", "label": "Show capsule" - }, - "capsule-opacity": { - "description": "Set the opacity level for widget backgrounds when capsule is shown.", - "label": "Capsule opacity" } }, "monitors": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 2e8239c0..7a4a2b4d 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Storage Space (Critical)" }, + "disk-path": { + "description": "Seleccione qué punto de montaje de disco desea supervisar.", + "label": "Ruta del disco" + }, "disk-warning-threshold": { "label": "Storage Space (Warning)" }, @@ -789,6 +793,10 @@ "description": "Ajusta la opacidad del fondo de la barra.", "label": "Opacidad del fondo" }, + "capsule-opacity": { + "description": "Establecer el nivel de opacidad para los fondos de los widgets cuando se muestra la cápsula.", + "label": "Opacidad de la cápsula" + }, "density": { "description": "Ajusta el relleno de la barra para un aspecto compacto o espacioso.", "label": "Densidad de la barra" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Mostrar fondos de los widgets.", "label": "Mostrar cápsula" - }, - "capsule-opacity": { - "description": "Establecer el nivel de opacidad para los fondos de los widgets cuando se muestra la cápsula.", - "label": "Opacidad de la cápsula" } }, "monitors": { diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 70b11ec6..89194bf5 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Storage Space (Critical)" }, + "disk-path": { + "description": "Sélectionnez le point de montage du disque à surveiller.", + "label": "Chemin du disque" + }, "disk-warning-threshold": { "label": "Storage Space (Warning)" }, @@ -789,6 +793,10 @@ "description": "Ajustez l'opacité de l'arrière-plan de la barre.", "label": "Opacité de l'arrière-plan" }, + "capsule-opacity": { + "description": "Définir le niveau d'opacité des arrière-plans des widgets quand la capsule est affichée.", + "label": "Opacité de la capsule" + }, "density": { "description": "Ajustez le remplissage de la barre pour un aspect compact ou spacieux.", "label": "Densité de la barre" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Afficher les arrière-plans des widgets.", "label": "Afficher la capsule" - }, - "capsule-opacity": { - "description": "Définir le niveau d'opacité des arrière-plans des widgets quand la capsule est affichée.", - "label": "Opacité de la capsule" } }, "monitors": { diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index b711e1b1..4db9ba44 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Opslagruimte (Kritiek)" }, + "disk-path": { + "description": "Selecteer welk schijfkoppelpunt u wilt monitoren.", + "label": "Schijfpad" + }, "disk-warning-threshold": { "label": "Opslagruimte (Waarschuwing)" }, @@ -789,6 +793,10 @@ "description": "Pas de achtergronddekking van de balk aan.", "label": "Achtergronddekking" }, + "capsule-opacity": { + "description": "Stel het doorzichtigheidsniveau in voor widget-achtergronden wanneer capsule wordt getoond.", + "label": "Capsule-doorzichtigheid" + }, "density": { "description": "Pas de opvulling van de balk aan voor een compacte of ruime uitstraling.", "label": "Balkdichtheid" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Widget-achtergronden tonen.", "label": "Capsules tonen" - }, - "capsule-opacity": { - "description": "Stel het doorzichtigheidsniveau in voor widget-achtergronden wanneer capsule wordt getoond.", - "label": "Capsule-doorzichtigheid" } }, "monitors": { diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 5f071fe0..8858f962 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Storage Space (Critical)" }, + "disk-path": { + "description": "Selecione qual ponto de montagem de disco monitorar.", + "label": "Caminho do disco" + }, "disk-warning-threshold": { "label": "Storage Space (Warning)" }, @@ -789,6 +793,10 @@ "description": "Ajuste a opacidade do fundo da barra.", "label": "Opacidade do fundo" }, + "capsule-opacity": { + "description": "Define o nível de opacidade para fundos dos widgets quando a cápsula é mostrada.", + "label": "Opacidade da cápsula" + }, "density": { "description": "Ajuste o preenchimento da barra para um visual compacto ou espaçoso.", "label": "Densidade da barra" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Mostra o fundo dos widgets.", "label": "Mostrar cápsula" - }, - "capsule-opacity": { - "description": "Define o nível de opacidade para fundos dos widgets quando a cápsula é mostrada.", - "label": "Opacidade da cápsula" } }, "monitors": { diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index 6c25c87e..9680f5d4 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Место на диске (Критично)" }, + "disk-path": { + "description": "Выберите точку монтирования диска для мониторинга.", + "label": "Путь к диску" + }, "disk-warning-threshold": { "label": "Место на диске (Предупреждение)" }, @@ -789,6 +793,10 @@ "description": "Настройка непрозрачности фона панели.", "label": "Непрозрачность фона" }, + "capsule-opacity": { + "description": "Установить уровень непрозрачности для фона виджетов, когда капсула отображается.", + "label": "Непрозрачность капсулы" + }, "density": { "description": "Настройка отступов панели для компактного или просторного вида.", "label": "Плотность панели" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Показывать фон виджетов.", "label": "Показывать капсулу" - }, - "capsule-opacity": { - "description": "Установить уровень непрозрачности для фона виджетов, когда капсула отображается.", - "label": "Непрозрачность капсулы" } }, "monitors": { diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 4bf5a8b2..a7617ab3 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Depolama Alanı (Kritik)" }, + "disk-path": { + "description": "İzlenecek disk bağlama noktasını seçin.", + "label": "Disk yolu" + }, "disk-warning-threshold": { "label": "Depolama Alanı (Uyarı)" }, @@ -789,6 +793,10 @@ "description": "Barın arka plan opaklığını ayarlayın.", "label": "Arka plan opaklığı" }, + "capsule-opacity": { + "description": "Kapsül gösterildiğinde widget arka planlarının saydamlık seviyesini ayarla.", + "label": "Kapsül saydamlığı" + }, "density": { "description": "Sıkı veya geniş bir görünüm için barın dolgusunu ayarlayın.", "label": "Bar yoğunluğu" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Widget arka planlarını göster.", "label": "Kapsülü göster" - }, - "capsule-opacity": { - "description": "Kapsül gösterildiğinde widget arka planlarının saydamlık seviyesini ayarla.", - "label": "Kapsül saydamlığı" } }, "monitors": { diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index 7089e65c..c078bcd3 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "Місце на диску (Критичний)" }, + "disk-path": { + "description": "Виберіть точку монтування диска для моніторингу.", + "label": "Шлях до диска" + }, "disk-warning-threshold": { "label": "Місце на диску (Попередження)" }, @@ -789,6 +793,10 @@ "description": "Налаштуйте непрозорість фону панелі.", "label": "Непрозорість фону" }, + "capsule-opacity": { + "description": "Встановити рівень непрозорості для фону віджетів, коли показано капсулу.", + "label": "Непрозорість капсули" + }, "density": { "description": "Налаштуйте відступи панелі для компактного або просторого вигляду.", "label": "Щільність панелі" @@ -818,10 +826,6 @@ "show-capsule": { "description": "Показувати фон віджетів.", "label": "Показувати капсулу" - }, - "capsule-opacity": { - "description": "Встановити рівень непрозорості для фону віджетів, коли показано капсулу.", - "label": "Непрозорість капсули" } }, "monitors": { diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index b6a1e7c5..8ac3748c 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -263,6 +263,10 @@ "disk-critical-threshold": { "label": "存储空间(严重)" }, + "disk-path": { + "description": "选择要监控的磁盘挂载点。", + "label": "磁盘路径" + }, "disk-warning-threshold": { "label": "存储空间(警告)" }, @@ -789,6 +793,10 @@ "description": "调整状态栏的背景不透明度。", "label": "背景不透明度" }, + "capsule-opacity": { + "description": "设置显示胶囊时小部件背景的不透明度。", + "label": "胶囊不透明度" + }, "density": { "description": "调整状态栏的内边距以获得紧凑或宽松的外观。", "label": "状态栏密度" @@ -818,10 +826,6 @@ "show-capsule": { "description": "为每个小部件添加背景。", "label": "显示组件背景" - }, - "capsule-opacity": { - "description": "设置显示胶囊时小部件背景的不透明度。", - "label": "胶囊不透明度" } }, "monitors": { diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index 09cd27a3..2f2fd5a1 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -40,6 +40,7 @@ Rectangle { readonly property bool showMemoryAsPercent: (widgetSettings.showMemoryAsPercent !== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent readonly property bool showNetworkStats: (widgetSettings.showNetworkStats !== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats readonly property bool showDiskUsage: (widgetSettings.showDiskUsage !== undefined) ? widgetSettings.showDiskUsage : widgetMetadata.showDiskUsage + readonly property string diskPath: (widgetSettings.diskPath !== undefined) ? widgetSettings.diskPath : widgetMetadata.diskPath readonly property real iconSize: textSize * 1.4 readonly property real textSize: { @@ -77,8 +78,8 @@ Rectangle { readonly property bool tempCritical: showCpuTemp && SystemStatService.cpuTemp > tempCriticalThreshold readonly property bool memWarning: showMemoryUsage && SystemStatService.memPercent > memWarningThreshold readonly property bool memCritical: showMemoryUsage && SystemStatService.memPercent > memCriticalThreshold - readonly property bool diskWarning: showDiskUsage && SystemStatService.diskPercents["/"] > diskWarningThreshold - readonly property bool diskCritical: showDiskUsage && SystemStatService.diskPercents["/"] > diskCriticalThreshold + readonly property bool diskWarning: showDiskUsage && SystemStatService.diskPercents[diskPath] > diskWarningThreshold + readonly property bool diskCritical: showDiskUsage && SystemStatService.diskPercents[diskPath] > diskCriticalThreshold TextMetrics { id: percentMetrics @@ -501,7 +502,7 @@ Rectangle { } NText { - text: `${SystemStatService.diskPercents["/"]}%` + text: SystemStatService.diskPercents[diskPath] ? `${SystemStatService.diskPercents[diskPath]}%` : "n/a" family: Settings.data.ui.fontFixed pointSize: textSize applyUiScale: false diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml index 58bed7a9..decb957d 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml @@ -2,6 +2,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import qs.Commons +import qs.Services.System import qs.Widgets ColumnLayout { @@ -20,6 +21,7 @@ ColumnLayout { property bool valueShowMemoryAsPercent: widgetData.showMemoryAsPercent !== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent property bool valueShowNetworkStats: widgetData.showNetworkStats !== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats property bool valueShowDiskUsage: widgetData.showDiskUsage !== undefined ? widgetData.showDiskUsage : widgetMetadata.showDiskUsage + property string valueDiskPath: widgetData.diskPath !== undefined ? widgetData.diskPath : widgetMetadata.diskPath function saveSettings() { var settings = Object.assign({}, widgetData || {}); @@ -30,6 +32,7 @@ ColumnLayout { settings.showMemoryAsPercent = valueShowMemoryAsPercent; settings.showNetworkStats = valueShowNetworkStats; settings.showDiskUsage = valueShowDiskUsage; + settings.diskPath = valueDiskPath; return settings; } @@ -96,4 +99,21 @@ ColumnLayout { checked: valueShowDiskUsage onToggled: checked => valueShowDiskUsage = checked } + + NComboBox { + id: diskPathComboBox + Layout.fillWidth: true + label: I18n.tr("bar.widget-settings.system-monitor.disk-path.label") + description: I18n.tr("bar.widget-settings.system-monitor.disk-path.description") + visible: valueShowDiskUsage + model: { + const paths = Object.keys(SystemStatService.diskPercents).sort(); + return paths.map(path => ({ + key: path, + name: path + })); + } + currentKey: valueDiskPath + onSelected: key => valueDiskPath = key + } } diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index 109136e0..50923e27 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -176,7 +176,8 @@ Singleton { "showMemoryUsage": true, "showMemoryAsPercent": false, "showNetworkStats": false, - "showDiskUsage": false + "showDiskUsage": false, + "diskPath": "/" }, "Taskbar": { "allowUserSettings": true,