Skip to content

Commit

Permalink
Fixed OS X used memory detection
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghetti2514 committed Aug 11, 2012
1 parent aa94513 commit 452e3e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion screenfetch-dev
Expand Up @@ -489,7 +489,7 @@ detectcpu () {
detectmem () {
if [ "$distro" == "Mac OS X" ]; then
totalmem=$(echo "$(sysctl -n hw.memsize)"/1024^2|bc)
usedmem=$(echo "$(sysctl -n hw.usermem)"/1024^2|bc)
usedmem=$(echo "$(top -l 1 | awk '/PhysMem/' | grep -o \[0-9]\*M | tail -2 | head -1)B")
else
total_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
totalmem=$((${total_mem}/1024))
Expand Down

0 comments on commit 452e3e6

Please sign in to comment.