From e631c2e3d3acf21bd1bd9b7f09dc93502ad7728d Mon Sep 17 00:00:00 2001 From: Souyama Date: Mon, 16 Jun 2025 16:59:15 +0530 Subject: [PATCH] fix swap usage nan --- .config/quickshell/services/ResourceUsage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/services/ResourceUsage.qml b/.config/quickshell/services/ResourceUsage.qml index c9a501bc2..6e0e58dff 100644 --- a/.config/quickshell/services/ResourceUsage.qml +++ b/.config/quickshell/services/ResourceUsage.qml @@ -17,7 +17,7 @@ Singleton { property double swapTotal: 1 property double swapFree: 1 property double swapUsed: swapTotal - swapFree - property double swapUsedPercentage: swapUsed / swapTotal + property double swapUsedPercentage: swapTotal > 0 ? (swapUsed / swapTotal) : 0 property double cpuUsage: 0 property var previousCpuStats @@ -59,4 +59,4 @@ Singleton { FileView { id: fileMeminfo; path: "/proc/meminfo" } FileView { id: fileStat; path: "/proc/stat" } -} \ No newline at end of file +}