CPU: Show an additional digit in cpu speed

This commit is contained in:
Dylan Araps 2017-03-09 11:47:52 +11:00
parent 1a6fe2099c
commit d8561cceed

View file

@ -810,11 +810,11 @@ get_cpu() {
speed="$(< "${speed_dir}/bios_limit")" || \ speed="$(< "${speed_dir}/bios_limit")" || \
speed="$(< "${speed_dir}/scaling_max_freq")" || \ speed="$(< "${speed_dir}/scaling_max_freq")" || \
speed="$(< "${speed_dir}/cpuinfo_max_freq")" speed="$(< "${speed_dir}/cpuinfo_max_freq")"
speed="$((speed / 100000))" speed="$((speed / 10000))"
else else
speed="$(awk -F ': |\\.' '/cpu MHz/ {printf $2; exit}' /proc/cpuinfo)" speed="$(awk -F ': |\\.' '/cpu MHz/ {printf $2; exit}' /proc/cpuinfo)"
speed="$((speed / 100))" speed="$((speed / 10))"
fi fi
# Get CPU temp. # Get CPU temp.
@ -882,7 +882,7 @@ get_cpu() {
# Get CPU speed. # Get CPU speed.
speed="$(sysctl -n hw.cpuspeed)" speed="$(sysctl -n hw.cpuspeed)"
[[ -z "$speed" ]] && speed="$(sysctl -n hw.clockrate)" [[ -z "$speed" ]] && speed="$(sysctl -n hw.clockrate)"
speed="$((speed / 100))" speed="$((speed / 10))"
# Get CPU cores. # Get CPU cores.
cores="$(sysctl -n hw.ncpu)" cores="$(sysctl -n hw.ncpu)"
@ -920,7 +920,7 @@ get_cpu() {
# Get CPU speed. # Get CPU speed.
speed="$(psrinfo -v | awk '/operates at/ {print $6; exit}')" speed="$(psrinfo -v | awk '/operates at/ {print $6; exit}')"
speed="$((speed / 100))" speed="$((speed / 10))"
# Get CPU cores. # Get CPU cores.
case "$cpu_cores" in case "$cpu_cores" in
@ -937,7 +937,7 @@ get_cpu() {
# Get CPU speed. # Get CPU speed.
speed="$(sysinfo -cpu | awk '/running at/ {print $NF; exit}')" speed="$(sysinfo -cpu | awk '/running at/ {print $NF; exit}')"
speed="${speed/MHz}" speed="${speed/MHz}"
speed="$((speed / 100))" speed="$((speed / 10))"
# Get CPU cores. # Get CPU cores.
cores="$(sysinfo -cpu | grep -c -F 'CPU #')" cores="$(sysinfo -cpu | grep -c -F 'CPU #')"
@ -950,7 +950,7 @@ get_cpu() {
# Get CPU speed. # Get CPU speed.
speed="$(prtconf | awk -F':' '/Processor Clock Speed/ {printf $2}')" speed="$(prtconf | awk -F':' '/Processor Clock Speed/ {printf $2}')"
speed="${speed/MHz}" speed="${speed/MHz}"
speed="$((speed / 100))" speed="$((speed / 10))"
# Get CPU cores. # Get CPU cores.
case "$cpu_cores" in case "$cpu_cores" in