From 0516471e72c213dc333ca297465a8c3a32f08267 Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Sun, 28 Jun 2020 13:34:08 -0400 Subject: [PATCH] mac compatability is working --- scripts/.ram_info.sh.swp | Bin 0 -> 12288 bytes scripts/ram_info.sh | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 scripts/.ram_info.sh.swp diff --git a/scripts/.ram_info.sh.swp b/scripts/.ram_info.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..eb675d967b73275fac4b31abb9aefb3e3be9dcb8 GIT binary patch literal 12288 zcmeI2&u<$=6vrn>Js8@8C>KtBwKs|#Sg*Y5iSXJ`H9&F4*4 zi88yT8yj`HP%H@?F9`AB&wt7vDL49R3CyU;}J`4X^<=zy{a=8(;%Zt${dP5Fa4>XT~!y z$LEE)^SH?;Hoykh02^QfY=8~00XDz}*Z><~18m?aG$30-eDbUi@;M}r|Nl?^{{QQF zA^rrvfnULQ;7c$7Hu&ST5D&o+G{D>7pHo8o0)7PFgNNWNFa#&SXD5aD7&zb#xCG9E zm%&Tm40wb*egZ#$Z^1XK z-L4xC@WdOp)^BcXEjYFR4A-a+);iK zWI8ZL(*qqV$ch5T?W%|xTW?{XGWIH~8YX*v5Gr~=?MQ``t&eiQn8gj*ze`K|VdVNT z88#V};nFD0NnQvX2O*hVDwCNg*8EAw-6H}xmZM`ea`|nv+dxdblX5OA&=L^Z@ z(!sGD$}YCH{p_n4)HEul@!ELY9F41ufkRE^8kqqtLgDoL$@ME$GRi}GbF)U{+;KOJ zP?Hhre00@zdRn&CT_??L*68yKs9Ht+4qHCyG&@HQWFIoknZ@!Xwq|Re#+g=q^IElPr=?DoPOT_y@>z- literal 0 HcmV?d00001 diff --git a/scripts/ram_info.sh b/scripts/ram_info.sh index 8f4d40a..3d40303 100755 --- a/scripts/ram_info.sh +++ b/scripts/ram_info.sh @@ -18,12 +18,12 @@ get_percent() Darwin) # percent=$(ps -A -o %mem | awk '{mem += $1} END {print mem}') - used_mem=$(vm_stat | grep -i "Pages active:" | sed 's/\.//g' | awk '{printf "%d", $3*4096/1024/1024}') + used_mem=$(top -l 1 -s 0 | grep PhysMem | sed 's/[a-z]//g; s/[A-Z]//g; s/[()]//g' | awk '{printf "%d\n", $2-$3-$5}') total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{print $2 $3}') if (( $used_mem < 1024 )); then echo $used_mem\M\B/$total_mem else - memory=$(($used_mem / 1024)) + memory=$(($used_mem/1024)) echo $memory\G\B/$total_mem fi ;;