CPU Usage: Add missing core commands and update old ones
This commit is contained in:
parent
98d2421b8b
commit
4f8bf2699d
8
neofetch
8
neofetch
|
@ -929,11 +929,13 @@ get_cpu_usage() {
|
||||||
|
|
||||||
*)
|
*)
|
||||||
# Get cores if unset
|
# Get cores if unset
|
||||||
if [[ -z "$cores" ]]; then
|
if [[ "$cpu_cores" == "off" ]]; then
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux") cores="$(awk -F ': ' '/siblings/ {printf $2; exit}' /proc/cpuinfo)" ;;
|
"Linux") cores="$(grep -c "^processor" /proc/cpuinfo)" ;;
|
||||||
"Mac OS X" | "BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
"Mac OS X") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
||||||
|
"BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
||||||
"Solaris") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
|
"Solaris") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
|
||||||
|
"Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;;
|
||||||
"iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;;
|
"iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
Reference in New Issue