mirror of
https://github.com/hykilpikonna/hyfetch.git
synced 2026-03-21 17:24:51 -05:00
[PR] fix cpu fetching code for leopard and tiger (#387)
* fix cpu fetching code for leopard and tiger * some 10.5 systems have this sysctl, just check if it exists like this
This commit is contained in:
parent
e691b2d9da
commit
5c24bd443a
18
neofetch
18
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}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user