Commit d7172fa8 authored by Dylan Araps's avatar Dylan Araps

memory: simplify

parent 41fd2df4
...@@ -1432,10 +1432,10 @@ get_gpu() { ...@@ -1432,10 +1432,10 @@ get_gpu() {
get_memory() { get_memory() {
case "$os" in case "$os" in
"Linux" | "Windows") "Linux" | "Windows")
IFS=$'\n'":kB" read -d "" -ra mem < /proc/meminfo
# MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable # MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
# Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716 # Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
IFS=$'\n'"|:|kB" read -d "" -ra mem < /proc/meminfo
mem_used="$(((mem[1] + mem[64] - mem[4] - mem[11] - mem[14]- mem[70]) / 1024))" mem_used="$(((mem[1] + mem[64] - mem[4] - mem[11] - mem[14]- mem[70]) / 1024))"
mem_total="$((mem[1] / 1024))" mem_total="$((mem[1] / 1024))"
;; ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment