From 4c860aaea47b035452b0bc9a87073ded6c2f637a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 5 Dec 2016 10:51:00 +1100 Subject: [PATCH] Memory: [FreeBSD] Fix memory usage --- neofetch | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/neofetch b/neofetch index 0c29e8f3..3cae7094 100755 --- a/neofetch +++ b/neofetch @@ -1083,13 +1083,7 @@ get_memory() { # Mem free case "$distro" in "NetBSD"*) mem_free="$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024))" ;; - "FreeBSD"* | "DragonFly"*) - mem_info=($(sysctl -n hw.pagesize bm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count)) - mem_inactive="$((mem_info[1] * meminfo[0]))" - mem_cache="$((mem_info[2] * meminfo[0]))" - mem_free="$((mem_info[3] * meminfo[0]))" - mem_free="$((mem_inactive + mem_cache + mem_free))" - ;; + "FreeBSD"* | "DragonFly"*) mem_free="$(top -d 1 | awk -F ',' '/^Mem:/ {print $5}')";; "OpenBSD"*) ;; *) mem_free="$(($(vmstat | awk 'END{printf $5}') / 1024))" ;; esac