baraction: Improve formatting of CPU speed

If the CPU is throttled to less than 1 GHz, the contents of the
bar will move around a bit; always use 4 digits to print the CPU
frequency so that doesn't happen.
This commit is contained in:
Andrea Bolognani 2019-11-21 17:39:22 +01:00 committed by LordReg
parent 9c77876ca8
commit 97b3f52ea8

View file

@ -78,7 +78,7 @@ print_apm() {
print_cpuspeed() {
CPU_SPEED=`/sbin/sysctl hw.cpuspeed | cut -d "=" -f2`
echo -n "CPU speed: $CPU_SPEED MHz "
printf "CPU speed: %4d MHz " $CPU_SPEED
}
while :; do