From 7f173060806f53a1a0c116a36efcfa7e65fe3d7b Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Mon, 22 May 2017 16:50:24 +0700 Subject: [PATCH] CPU [IRIX]: Fix CPU speed.... kinda. --- neofetch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 2b2fd13c..7f6c404a 100755 --- a/neofetch +++ b/neofetch @@ -983,13 +983,18 @@ get_cpu() { "IRIX") # Get CPU name. - cpu="$(hinv -c | awk -F':' '/CPU:/ {printf $2}')" + cpu="$(hinv -c processor | awk -F':' '/CPU:/ {printf $2}')" # Get CPU speed. - cpu="$(hinv -c | awk 'NR==1{printf $2}')" + cpu="$(hinv -c processor | awk '/MHZ/ {printf $2}')" + + # Note: This is an inaccurate way to count CPU speed. + # Most of them use MHZ, I'm yet to see if they have + # anything above 1 GHZ. So this will have to do as a + # place holder. # Get CPU cores. - cores="$(sysconf NPROC_ONLN)" # Does this even work? + cores="$(sysconf NPROC_ONLN)" ;; esac @@ -1069,7 +1074,7 @@ get_cpu_usage() { "Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;; "iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;; "AIX") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;; - "IRIX") cores="$(sysconf NPROC_ONLN)" # Does this even work? + "IRIX") cores="$(sysconf NPROC_ONLN)" esac fi