Memory: [FreeBSD] Fix memory usage
This commit is contained in:
parent
13135b698e
commit
4c860aaea4
1 changed files with 1 additions and 7 deletions
8
neofetch
8
neofetch
|
@ -1083,13 +1083,7 @@ get_memory() {
|
||||||
# Mem free
|
# Mem free
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
"NetBSD"*) mem_free="$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024))" ;;
|
"NetBSD"*) mem_free="$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024))" ;;
|
||||||
"FreeBSD"* | "DragonFly"*)
|
"FreeBSD"* | "DragonFly"*) mem_free="$(top -d 1 | awk -F ',' '/^Mem:/ {print $5}')";;
|
||||||
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))"
|
|
||||||
;;
|
|
||||||
"OpenBSD"*) ;;
|
"OpenBSD"*) ;;
|
||||||
*) mem_free="$(($(vmstat | awk 'END{printf $5}') / 1024))" ;;
|
*) mem_free="$(($(vmstat | awk 'END{printf $5}') / 1024))" ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue