From abc58ce2aa417ca7b6923e0aabbe9f037e971ec0 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Sun, 21 May 2023 12:35:07 +0200
Subject: Slightly change the way memory is presented
---
lib/subcommands/sysinfo.bash | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'lib/subcommands/sysinfo.bash')
diff --git a/lib/subcommands/sysinfo.bash b/lib/subcommands/sysinfo.bash
index f9f81ba..27e6b55 100644
--- a/lib/subcommands/sysinfo.bash
+++ b/lib/subcommands/sysinfo.bash
@@ -17,7 +17,7 @@ subcommand() {
load_5="$(awk '{ print $2 }' < /proc/loadavg)"
load_15="$(awk '{ print $3 }' < /proc/loadavg)"
memory_total="$(awk '/MemTotal/ { print $2 }' < /proc/meminfo)"
- memory_free="$(awk '/MemFree/ { print $2 }' < /proc/meminfo)"
+ memory_free="$(awk '/MemAvailable/ { print $2 }' < /proc/meminfo)"
memory_used=$(( memory_total - memory_free ))
uptime="$(awk -F. '{ print $1 }' < /proc/uptime)"
@@ -35,7 +35,7 @@ subcommand() {
"$(( uptime / 60 / 60 % 24 ))" \
"$(( uptime / 60 % 60 ))" \
"$(( uptime % 60 ))"
- printf "%-15s %dGi / %dGi\n" "memory" \
+ printf "%-15s %3dGi / %3dGi\n" "memory" \
"$(( memory_used / 1024 / 1024 ))" \
"$(( memory_total / 1024 / 1024 ))"
printf "%-15s %s %s %s\n" "load" \
--
cgit v1.1