mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 12:09:55 +00:00
memory: simplify
This commit is contained in:
4
neofetch
4
neofetch
@@ -1432,10 +1432,10 @@ get_gpu() {
|
||||
get_memory() {
|
||||
case "$os" in
|
||||
"Linux" | "Windows")
|
||||
IFS=$'\n'":kB" read -d "" -ra mem < /proc/meminfo
|
||||
|
||||
# MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
|
||||
# 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_total="$((mem[1] / 1024))"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user