mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 03:59:58 +00:00
OS X: Added wired memory to memory usage
This commit is contained in:
3
fetch
3
fetch
@@ -934,9 +934,10 @@ getmemory () {
|
|||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
memtotal=$(printf "%s\n" "$(sysctl -n hw.memsize)"/1024^2 | bc)
|
memtotal=$(printf "%s\n" "$(sysctl -n hw.memsize)"/1024^2 | bc)
|
||||||
|
memwired=$(vm_stat | awk '/wired/ { print $4 }')
|
||||||
memactive=$(vm_stat | awk '/active / { printf $3 }')
|
memactive=$(vm_stat | awk '/active / { printf $3 }')
|
||||||
memcompressed=$(vm_stat | awk '/occupied/ { printf $5 }')
|
memcompressed=$(vm_stat | awk '/occupied/ { printf $5 }')
|
||||||
memused=$(((${memactive//.} + ${memcompressed//.}) * 4 / 1024))
|
memused=$(((${wiredmem//.} + ${memactive//.} + ${memcompressed//.}) * 4 / 1024))
|
||||||
memory="${memused}MB / ${memtotal}MB"
|
memory="${memused}MB / ${memtotal}MB"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user