diff --git a/neofetch b/neofetch index 69dd871e..f1f30e7f 100755 --- a/neofetch +++ b/neofetch @@ -3175,19 +3175,10 @@ END ;; "Mac OS X"|"macOS") - if [[ $osx_version == 10.[4-5]* ]]; then - cpu="$(system_profiler SPHardwareDataType | grep CPU\ Type)" - cpu="${cpu/CPU\ Type\:/}" - - speed="$(system_profiler SPHardwareDataType | grep CPU\ Speed)" - speed="${speed/CPU\ Speed\:/}" - speed="${speed/ MHz/}" - speed="${speed/ GHz/}" - - cores="$(system_profiler SPHardwareDataType | grep Number\ Of\ CPUs)" - cores="${cores/Number\ Of\ CPUs\:/}" - else - cpu="$(sysctl -n machdep.cpu.brand_string)" + cpu="$(sysctl -n machdep.cpu.brand_string 2>/dev/null)" + if [ -z "$cpu" ]; then + cpu="$(system_profiler SPHardwareDataType | grep Processor\ Name)" + cpu="${cpu/Processor\ Name\:/}" fi # Get CPU cores. @@ -3374,7 +3365,6 @@ END cpu="${cpu//[1-9][0-9]-Core}" cpu="${cpu//[0-9]-Core}" cpu="${cpu//, * Compute Cores}" - cpu="${cpu//Core / }" cpu="${cpu//(\"AuthenticAMD\"*)}" cpu="${cpu//with Radeon*Graphics}" cpu="${cpu//, altivec supported}"