Improving MacOS M1 CPU/GPU prints
This commit is contained in:
parent
ccd5d9f526
commit
75619edf01
1 changed files with 18 additions and 6 deletions
24
neofetch
24
neofetch
|
|
@ -2471,8 +2471,14 @@ get_cpu() {
|
||||||
# Add CPU cores to the output.
|
# Add CPU cores to the output.
|
||||||
[[ "$cpu_cores" != "off" && "$cores" ]] && \
|
[[ "$cpu_cores" != "off" && "$cores" ]] && \
|
||||||
case $os in
|
case $os in
|
||||||
"Mac OS X"|"macOS") cpu="${cpu/@/(${cores}) @}" ;;
|
"Mac OS X"|"macOS")
|
||||||
*) cpu="$cpu ($cores)" ;;
|
if [[ $(uname -m) == 'arm64' ]]; then
|
||||||
|
cpu="$cpu ($cores)"
|
||||||
|
else
|
||||||
|
cpu="${cpu/@/(${cores}) @}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*) cpu="$cpu ($cores)" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Add CPU speed to the output.
|
# Add CPU speed to the output.
|
||||||
|
|
@ -2591,10 +2597,16 @@ get_gpu() {
|
||||||
source "${cache_dir}/neofetch/gpu"
|
source "${cache_dir}/neofetch/gpu"
|
||||||
|
|
||||||
else
|
else
|
||||||
gpu="$(system_profiler SPDisplaysDataType |\
|
if [[ $(uname -m) == 'arm64' ]]; then
|
||||||
awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')"
|
chipset=$(system_profiler SPDisplaysDataType | awk '/Chipset Model/ { printf "%s %s %s", $3, $4, $5 }')
|
||||||
gpu="${gpu//\/ \$}"
|
cores=$(system_profiler SPDisplaysDataType | awk '/Total Number of Cores/ { printf "%d", $5 }')
|
||||||
gpu="${gpu%,*}"
|
gpu="${chipset} (${cores})"
|
||||||
|
else
|
||||||
|
gpu="$(system_profiler SPDisplaysDataType |\
|
||||||
|
awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')"
|
||||||
|
gpu="${gpu//\/ \$}"
|
||||||
|
gpu="${gpu%,*}"
|
||||||
|
fi
|
||||||
|
|
||||||
cache "gpu" "$gpu"
|
cache "gpu" "$gpu"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue