From 0168516a2c00b115b7b0ace7e36ac7f2da6ece7e Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Wed, 14 Nov 2018 07:05:40 +0700 Subject: [PATCH] Memory [Solaris]: Detect using a new method using pages --- neofetch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index c817e469..eab32694 100755 --- a/neofetch +++ b/neofetch @@ -2269,8 +2269,9 @@ get_memory() { ;; "Solaris") - mem_total="$(prtconf | awk '/Memory/ {print $3}')" - mem_free="$(($(vmstat | awk 'NR==3{printf $5}') / 1024))" + hw_pagesize="$(pagesize)" + mem_total="$(($(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}') * hw_pagesize / 1024 / 1024))" + mem_free="$(($(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}') * hw_pagesize / 1024 / 1024))" mem_used="$((mem_total - mem_free))" ;;