aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/subcommands/sysinfo.bash4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/subcommands/sysinfo.bash b/lib/subcommands/sysinfo.bash
index 5514c43..1b34993 100644
--- a/lib/subcommands/sysinfo.bash
+++ b/lib/subcommands/sysinfo.bash
@@ -21,7 +21,9 @@ subcommand() {
load_1="$(uptime | awk -F' *,? *' '{ print $(NF-2) }')"
load_5="$(uptime | awk -F' *,? *' '{ print $(NF-1) }')"
load_15="$(uptime | awk -F' *,? *' '{ print $NF }')"
- memory_total=$(( "$(sysctl hw.physmem | awk '{ print $NF }')" / 1024 ))
+ memory_total=$(( $(sysctl -n hw.physmem) / 1024 ))
+ memory_used=$(( ( $(sysctl -n vm.stats.vm.v_active_count) * $(sysctl -n hw.pagesize) ) / 1024 ))
+ memory_free=$(( memory_total - memory_used))
storage_used="$(df -c | tail -n1 | awk '{ print $3 }')"
storage_free="$(df -c | tail -n1 | awk '{ print $4 }')"
storage_total=$(( storage_used + storage_free ))