Merge branch 'master' of github.com:dylanaraps/neofetch

This commit is contained in:
Dylan Araps 2019-01-20 05:36:44 +02:00
commit e3a6b9f40d

View file

@ -2307,10 +2307,20 @@ get_memory() {
esac
;;
"Solaris")
"Solaris" | "AIX")
hw_pagesize="$(pagesize)"
pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')"
pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')"
case "$os" in
"Solaris")
pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')"
pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')"
;;
"AIX")
IFS=$'\n'"| " read -d "" -ra mem_stat <<< "$(svmon -G -O unit=page)"
pages_total="${mem_stat[11]}"
pages_free="${mem_stat[16]}"
;;
esac
mem_total="$((pages_total * hw_pagesize / 1024 / 1024))"
mem_free="$((pages_free * hw_pagesize / 1024 / 1024))"
mem_used="$((mem_total - mem_free))"
@ -2322,15 +2332,6 @@ get_memory() {
mem_used="$((${mem_used/max} / 1024 / 1024))"
;;
"AIX")
IFS=$'\n'"| " read -d "" -ra mem_stat <<< "$(svmon -G -O unit=MB)"
mem_total="${mem_stat[11]/.*}"
mem_free="${mem_stat[16]/.*}"
mem_used="$((mem_total - mem_free))"
mem_label="MB"
;;
"IRIX")
IFS=$'\n' read -d "" -ra mem_cmd <<< "$(pmem)"
IFS=" " read -ra mem_stat <<< "${mem_cmd[0]}"