Windows memory usage (untested)
This commit is contained in:
parent
18d465a6d2
commit
9f1c18e90d
1 changed files with 14 additions and 0 deletions
14
fetch.sh
14
fetch.sh
|
@ -522,6 +522,20 @@ getmemory () {
|
||||||
memory="${memused}MB / ${memtotal}MB"
|
memory="${memused}MB / ${memtotal}MB"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Windows")
|
||||||
|
mem="$(awk 'NR < 3 {printf $2 " "}' /proc/meminfo)"
|
||||||
|
|
||||||
|
# Split the string above into 2 vars
|
||||||
|
# This is faster than using an array.
|
||||||
|
set $mem
|
||||||
|
|
||||||
|
memtotal=$1
|
||||||
|
memfree=$2
|
||||||
|
memavail=$((memtotal - memfree))
|
||||||
|
memused=$((memtotal - memavail))
|
||||||
|
memory="$(( ${memused%% *} / 1024))MB / $(( ${memtotal%% *} / 1024))MB"
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
memory="Unknown"
|
memory="Unknown"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue