From fc8f655bb7f30277032b69e0a3f09ec3e92cdcb7 Mon Sep 17 00:00:00 2001 From: Narvin Singh Date: Thu, 24 Dec 2020 10:46:11 -0500 Subject: [PATCH] Fix: Memory usage using raw numbers Use free without -h to get raw numbers to report correct memory usage, otherwise when the free memory is a lower order of magnitude than the total memory, e.g., the free memory is in MiB and the total memory is in GiB, then the human-readable free memory number will be too large compared to the total memory number. --- status-bar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/status-bar b/status-bar index f091bc9..a81c7a9 100755 --- a/status-bar +++ b/status-bar @@ -32,7 +32,7 @@ status_cpu() { } status_mem() { - printf '%.0f%%' "$(free -h | awk 'NR == 2 {print $3 * 100 / $2}')" + printf '%.0f%%' "$(free | awk 'NR == 2 {print $3 * 100 / $2}')" } status_bl () {