mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-22 03:37:12 +00:00
Fix used memory on FreeBSD
This commit is contained in:
6
fetch
6
fetch
@@ -629,10 +629,12 @@ getmemory () {
|
|||||||
|
|
||||||
*"BSD")
|
*"BSD")
|
||||||
memtotal=$(dmesg | awk '/real mem/ {printf $5}')
|
memtotal=$(dmesg | awk '/real mem/ {printf $5}')
|
||||||
memused=$(top -d1 | awk '/Mem:/ {print $4}')
|
|
||||||
memtotal=${memtotal/\(/}
|
memtotal=${memtotal/\(/}
|
||||||
memtotal=${memtotal/)MB/}
|
memtotal=${memtotal/)MB/}
|
||||||
memused=${memused/M/}
|
memfree=$(top -d1 | awk '/Mem:/ {print $10}')
|
||||||
|
memfree=${memfree/M/}
|
||||||
|
memused=$((memtotal - memfree))
|
||||||
|
|
||||||
memory="${memused}MB / ${memtotal}MB"
|
memory="${memused}MB / ${memtotal}MB"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user