From ed9cbac23335c9ad8cb5d1f822917caac374996b Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 18 Jan 2016 16:44:55 +1100 Subject: [PATCH] Fix used memory on FreeBSD --- fetch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fetch b/fetch index f54b2de6..7d973b34 100755 --- a/fetch +++ b/fetch @@ -629,10 +629,12 @@ getmemory () { *"BSD") memtotal=$(dmesg | awk '/real mem/ {printf $5}') - memused=$(top -d1 | awk '/Mem:/ {print $4}') memtotal=${memtotal/\(/} memtotal=${memtotal/)MB/} - memused=${memused/M/} + memfree=$(top -d1 | awk '/Mem:/ {print $10}') + memfree=${memfree/M/} + memused=$((memtotal - memfree)) + memory="${memused}MB / ${memtotal}MB" ;;