Fix memory output on OpenBSD
This commit is contained in:
parent
17cd68ba6b
commit
030263465f
1 changed files with 8 additions and 1 deletions
9
neofetch
9
neofetch
|
@ -1134,7 +1134,14 @@ getmemory () {
|
|||
|
||||
"OpenBSD" | "BSD")
|
||||
case "$distro" in
|
||||
"OpenBSD"* | "FreeBSD"*)
|
||||
"OpenBSD"*)
|
||||
mem=($(top -d 1 | awk -F ': |/| |M' '/Memory:/ {printf $4 " " $6 " " $11 "\n"}'))
|
||||
memtotal=$((${mem[1]} + ${mem[2]}))
|
||||
memused=$((memtotal - ${mem[0]}))
|
||||
memory="${memused}MB / ${memtotal}MB"
|
||||
;;
|
||||
|
||||
"FreeBSD"*)
|
||||
memtotal=$(dmesg | awk '/real mem/ {printf $5}')
|
||||
memtotal=${memtotal/\(}
|
||||
memtotal=${memtotal/MB\)}
|
||||
|
|
Loading…
Reference in a new issue