From 7ea4aa2e8296946b98177fad45e3303e30b90b93 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 12 Aug 2016 23:46:46 +1000 Subject: [PATCH] Simplify CPU commands --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 8a1551fd..49ae825c 100755 --- a/neofetch +++ b/neofetch @@ -728,11 +728,11 @@ getcpu() { cpu="${cpu/ @*}" # Get cpu speed - speed="$(psrinfo -v | tail -2 | head -1 | awk '{print $6}')" + speed="$(psrinfo -v | awk '/operates at/ {print $6}')" speed="$((speed / 100))" # Get cpu cores - cores="$(kstat -m cpu_info | grep "chip_id" | wc -l | tr -d ' ')" + cores="$(kstat -m cpu_info | grep -c "chip_id")" # Fix for speeds under 1ghz if [ -z "${speed:1}" ]; then