OpenBSD: change cpu count (#1650)
Instead of using hw.ncpu, use hw.ncpuonline and hw.ncpufound, and check SMT status
This commit is contained in:
parent
0bbd6bff86
commit
9b1108133c
1 changed files with 11 additions and 1 deletions
12
neofetch
12
neofetch
|
@ -2286,7 +2286,17 @@ get_cpu() {
|
|||
[[ -z "$speed" ]] && speed="$(sysctl -n hw.clockrate)"
|
||||
|
||||
# Get CPU cores.
|
||||
cores="$(sysctl -n hw.ncpu)"
|
||||
case $kernel_name in
|
||||
"OpenBSD"*)
|
||||
[[ "$(sysctl -n hw.smt)" == "1" ]] && smt="on" || smt="off"
|
||||
ncpufound="$(sysctl -n hw.ncpufound)"
|
||||
ncpuonline="$(sysctl -n hw.ncpuonline)"
|
||||
cores="${ncpuonline}/${ncpufound},\\xc2\\xa0SMT\\xc2\\xa0${smt}"
|
||||
;;
|
||||
*)
|
||||
cores="$(sysctl -n hw.ncpu)"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get CPU temp.
|
||||
case $kernel_name in
|
||||
|
|
Loading…
Reference in a new issue