commit e13eff1c2c9643bf63a484222430cc3880b98d3d parent 0f4869662c6ea6f5d4b976d5ff95b12d2f1cf198 Author: hhvn <dev@hhvn.uk> Date: Sat, 30 Dec 2023 13:42:49 +0000 Fix memory status Diffstat:
M | status/03-mem.go | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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)