cpu: Simplify cpu_cores
This commit is contained in:
parent
a2769a93ed
commit
ec29e74406
1 changed files with 3 additions and 3 deletions
6
neofetch
6
neofetch
|
@ -1002,9 +1002,9 @@ get_distro() {
|
||||||
*) machine_arch="$(uname -m)" ;;
|
*) machine_arch="$(uname -m)" ;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
if [[ "$os_arch" == "on" ]]; then
|
|
||||||
|
[[ "$os_arch" == "on" ]] && \
|
||||||
distro+=" ${machine_arch}"
|
distro+=" ${machine_arch}"
|
||||||
fi
|
|
||||||
|
|
||||||
[[ "${ascii_distro:-auto}" == "auto" ]] && \
|
[[ "${ascii_distro:-auto}" == "auto" ]] && \
|
||||||
ascii_distro="$(trim "$distro")"
|
ascii_distro="$(trim "$distro")"
|
||||||
|
@ -1793,7 +1793,7 @@ get_cpu() {
|
||||||
# Get CPU cores.
|
# Get CPU cores.
|
||||||
case "$cpu_cores" in
|
case "$cpu_cores" in
|
||||||
"logical" | "on") cores="$(grep -c "^processor" "$cpu_file")" ;;
|
"logical" | "on") cores="$(grep -c "^processor" "$cpu_file")" ;;
|
||||||
"physical") cores="$(grep "^core id" "$cpu_file" | sort -u | wc -l)" ;;
|
"physical") cores="$(awk '/^core id/&&!a[$0]++{++i}END{print i}' "$cpu_file")" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue