From 9f1c18e90d62a7bf79af98154f3125dc0b4c370d Mon Sep 17 00:00:00 2001 From: dylan araps Date: Tue, 5 Jan 2016 17:10:34 +1100 Subject: [PATCH] Windows memory usage (untested) --- fetch.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fetch.sh b/fetch.sh index 2330d3b1..7524dff1 100755 --- a/fetch.sh +++ b/fetch.sh @@ -522,6 +522,20 @@ getmemory () { 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" ;;