From fcb128faac9144e6dbd1a1c0889648a0e87eaa9a Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 13 May 2016 10:21:53 +1000 Subject: [PATCH] Check /proc/meminfo on NetBSD --- neofetch | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/neofetch b/neofetch index 8f7d5fe2..c00fa3c6 100755 --- a/neofetch +++ b/neofetch @@ -1386,13 +1386,6 @@ getgpu () { # Memory {{{ getmemory () { - # NetBSD emulates the linux /proc filesystem instead of using sysctl for hw - # information so we have to use this block below which temporarily sets the - # OS to 'Linux' for the duration of this function. - case "$distro" in - "NetBSD"*) local os="Linux" ;; - esac - case "$os" in "Linux" | "Windows") if [ ! -z "$(grep -F "MemAvail" /proc/meminfo)" ]; then @@ -1418,6 +1411,7 @@ getmemory () { "BSD") memtotal=$(($(sysctl -n hw.physmem) / 1024 / 1024)) memfree=$(($(vmstat | awk 'END{printf $5}') / 1024)) + [ "$distro" == "NetBSD" ] && memfree=$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024)) memused=$((memtotal - memfree)) ;; esac