diff options
author | Patrick Spek <p.spek@tyil.nl> | 2023-05-21 12:35:07 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2023-05-21 12:35:07 +0200 |
commit | abc58ce2aa417ca7b6923e0aabbe9f037e971ec0 (patch) | |
tree | 25e90d46b8c8cd1442707ee9630fc9c68836035d /lib | |
parent | 6758f4bd07eb86fd9c32adbe1107cdc1b11919e1 (diff) |
Slightly change the way memory is presented
Diffstat (limited to 'lib')
-rw-r--r-- | lib/subcommands/sysinfo.bash | 4 |
1 files changed, 2 insertions, 2 deletions
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" \ |