diff --git a/Commons/Color.qml b/Commons/Color.qml index fa2912e..7abc21f 100644 --- a/Commons/Color.qml +++ b/Commons/Color.qml @@ -112,7 +112,7 @@ Singleton { Logger.log("Color", "Writing colors to disk") writeAdapter() } - + // Trigger initial load when path changes from empty to actual path onPathChanged: { if (path === Settings.configDir + "colors.json") { diff --git a/Commons/Settings.qml b/Commons/Settings.qml index ef38b47..da0da40 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -183,7 +183,7 @@ Singleton { Quickshell.execDetached(["mkdir", "-p", configDir]) Quickshell.execDetached(["mkdir", "-p", cacheDir]) Quickshell.execDetached(["mkdir", "-p", cacheDirImages]) - + // Mark directories as created and trigger file loading directoriesCreated = true } @@ -203,7 +203,7 @@ Singleton { watchChanges: true onFileChanged: reload() onAdapterUpdated: saveTimer.start() - + // Trigger initial load when path changes from empty to actual path onPathChanged: { if (path === settingsFile) { diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index e9c4ad2..91f3fd8 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -34,6 +34,8 @@ RowLayout { readonly property bool showCpuTemp: (widgetSettings.showCpuTemp !== undefined) ? widgetSettings.showCpuTemp : widgetMetadata.showCpuTemp readonly property bool showMemoryUsage: (widgetSettings.showMemoryUsage !== undefined) ? widgetSettings.showMemoryUsage : widgetMetadata.showMemoryUsage + readonly property bool showMemoryAsPercent: (widgetSettings.showMemoryAsPercent + !== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent readonly property bool showNetworkStats: (widgetSettings.showNetworkStats !== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats @@ -117,7 +119,7 @@ RowLayout { } NText { - text: `${SystemStatService.memGb}G` + text: showMemoryAsPercent ? `${SystemStatService.memPercent}%` : `${SystemStatService.memGb}G` font.family: Settings.data.ui.fontFixed font.pointSize: Style.fontSizeS * scaling font.weight: Style.fontWeightMedium diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index c51c469..d8bb543 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -43,7 +43,7 @@ Item { property color effectColor: Color.mPrimary property int horizontalPadding: Math.round(Style.marginS * scaling) - property int spacingBetweenPills: Math.round(Style.marginXS * scaling) + property int spacingBetweenPills: Math.round(Style.marginXS * scaling) signal workspaceChanged(int workspaceId, color accentColor) diff --git a/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml b/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml index 171e0ce..4f2459b 100644 --- a/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml +++ b/Modules/SettingsPanel/Bar/WidgetSettings/SystemMonitorSettings.qml @@ -17,6 +17,8 @@ ColumnLayout { property bool valueShowCpuUsage: widgetData.showCpuUsage !== undefined ? widgetData.showCpuUsage : widgetMetadata.showCpuUsage property bool valueShowCpuTemp: widgetData.showCpuTemp !== undefined ? widgetData.showCpuTemp : widgetMetadata.showCpuTemp property bool valueShowMemoryUsage: widgetData.showMemoryUsage !== undefined ? widgetData.showMemoryUsage : widgetMetadata.showMemoryUsage + property bool valueShowMemoryAsPercent: widgetData.showMemoryAsPercent + !== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent property bool valueShowNetworkStats: widgetData.showNetworkStats !== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats @@ -25,6 +27,7 @@ ColumnLayout { settings.showCpuUsage = valueShowCpuUsage settings.showCpuTemp = valueShowCpuTemp settings.showMemoryUsage = valueShowMemoryUsage + settings.showMemoryAsPercent = valueShowMemoryAsPercent settings.showNetworkStats = valueShowNetworkStats return settings } @@ -53,6 +56,14 @@ ColumnLayout { onToggled: checked => valueShowMemoryUsage = checked } + NToggle { + id: showMemoryAsPercent + Layout.fillWidth: true + label: "Show memory as percentage" + checked: valueShowMemoryAsPercent + onToggled: checked => valueShowMemoryAsPercent = checked + } + NToggle { id: showNetworkStats Layout.fillWidth: true diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index 6bd4395..b82a3e1 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -83,6 +83,7 @@ Singleton { "showCpuUsage": true, "showCpuTemp": true, "showMemoryUsage": true, + "showMemoryAsPercent": false, "showNetworkStats": false }, "Workspace": {