Merge branch 'master' of github.com:dylanaraps/neofetch
This commit is contained in:
commit
58e833cd10
1 changed files with 3 additions and 11 deletions
14
neofetch
14
neofetch
|
@ -1114,17 +1114,9 @@ getgpu () {
|
||||||
getmemory () {
|
getmemory () {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux")
|
"Linux")
|
||||||
# Read first 3 lines
|
mem=($(awk -F ':| kB' '/MemTotal|MemFree|Buffers|Cached/ {printf $2}' /proc/meminfo ))
|
||||||
mem=$(awk -F ':' '/MemTotal|MemAvailable/ {printf $2}' /proc/meminfo )
|
memused=$((${mem[0]} - ${mem[1]} - ${mem[2]} - ${mem[3]}))
|
||||||
|
memory="$((memused / 1024))MB / $((${mem[0]} / 1024))MB"
|
||||||
# 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"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
|
|
Loading…
Reference in a new issue