Merge branch 'master' of github.com:dylanaraps/neofetch

This commit is contained in:
Dylan 2016-03-26 22:37:25 +11:00
commit 58e833cd10
1 changed files with 3 additions and 11 deletions

View File

@ -1114,17 +1114,9 @@ getgpu () {
getmemory () {
case "$os" in
"Linux")
# Read first 3 lines
mem=$(awk -F ':' '/MemTotal|MemAvailable/ {printf $2}' /proc/meminfo )
# Do some substitution on each line
memtotal=${mem/kB*/kB}
memavail=${mem/${memtotal}}
memtotal=${memtotal/kB*}
memavail=${memavail/kB*}
memused=$((memtotal - memavail))
memory="$((memused / 1024))MB / $((memtotal / 1024))MB"
mem=($(awk -F ':| kB' '/MemTotal|MemFree|Buffers|Cached/ {printf $2}' /proc/meminfo ))
memused=$((${mem[0]} - ${mem[1]} - ${mem[2]} - ${mem[3]}))
memory="$((memused / 1024))MB / $((${mem[0]} / 1024))MB"
;;
"Mac OS X")