From e13eff1c2c9643bf63a484222430cc3880b98d3d Mon Sep 17 00:00:00 2001 From: hhvn Date: Sat, 30 Dec 2023 13:42:49 +0000 Subject: Fix memory status --- status/03-mem.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'status') diff --git a/status/03-mem.go b/status/03-mem.go index c566c4c..89dbb59 100644 --- a/status/03-mem.go +++ b/status/03-mem.go @@ -37,8 +37,8 @@ func mem(name string) error { if err := checkMemField(mem, "MemAvailable"); err != nil { return err } total := mem["MemTotal"] - avail := mem["MemAvailable"] - p := int(float64(avail) / float64(total) * 100.0) + used := total - mem["MemAvailable"] + p := int(float64(used) / float64(total) * 100.0) cx := 0 cx += u.drawPercentBar(cx, p) -- cgit v1.2.3