From 4626349b4d56eeabaa8840c09891aab7cbba2829 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Wed, 4 Jan 2017 09:31:55 +0700 Subject: [PATCH] CPU: Added initial support for AIX --- neofetch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/neofetch b/neofetch index 40a5d638..1df45d03 100755 --- a/neofetch +++ b/neofetch @@ -278,6 +278,10 @@ get_model() { "Solaris") model="$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')" ;; + + "AIX") + model="$(prtconf | awk -F':' '/System Model/ {printf $2}')" + ;; esac # Remove dummy OEM info. @@ -911,6 +915,22 @@ get_cpu() { # Get CPU cores. cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;; + + "AIX") + # Get CPU name. + cpu="$(prtconf | awk -F':' '/Processor Type/ {printf $2}')" + + # Get CPU speed. + speed="$(prtconf | awk -F':' '/Processor Clock Speed/ {printf $2}')" + speed="${speed/MHz}" + speed="$((speed / 100))" + + # Get CPU cores. + case "$cpu_cores" in + "logical" | "on") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;; + "physical") cores="$(lparstat -i | awk -F':' '/Active Physical CPUs/ {printf $2}')" + esac + ;; esac # Fix for speeds under 1ghz.