CPU: Fix inaccurate speed for processors below 1GHz
This commit is contained in:
parent
347854b296
commit
63b26285fb
1 changed files with 4 additions and 9 deletions
13
neofetch
13
neofetch
|
@ -1014,19 +1014,14 @@ get_cpu() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "$speed" ]]; then
|
if [[ "$speed" ]]; then
|
||||||
# Hide decimals if on.
|
if (( speed < 1000 )); then
|
||||||
[[ "$speed_shorthand" == "on" ]] && \
|
cpu="$cpu @ ${speed}MHz $temp"
|
||||||
speed="$((speed / 100))"
|
|
||||||
|
|
||||||
# Fix for speeds under 1ghz.
|
|
||||||
if [[ -z "${speed:1}" ]]; then
|
|
||||||
speed="0.${speed}"
|
|
||||||
else
|
else
|
||||||
|
[[ "$speed_shorthand" == "on" ]] && speed="$((speed / 100))"
|
||||||
speed="${speed:0:1}.${speed:1}"
|
speed="${speed:0:1}.${speed:1}"
|
||||||
fi
|
|
||||||
|
|
||||||
cpu="$cpu @ ${speed}GHz $temp"
|
cpu="$cpu @ ${speed}GHz $temp"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove un-needed patterns from cpu output.
|
# Remove un-needed patterns from cpu output.
|
||||||
cpu="${cpu//(TM)}"
|
cpu="${cpu//(TM)}"
|
||||||
|
|
Loading…
Reference in a new issue