only use 1 decimal place on cpu freq

This commit is contained in:
Dustin Kirkland 2009-04-06 23:24:37 -07:00
commit 290ce20afc
2 changed files with 6 additions and 6 deletions

View file

@ -57,11 +57,11 @@ for bat in $BATS; do
rem=$(search "$statefile" "remaining capacity: *\(.*\) m[AW]h")
if [ "$rem" -lt "$low" ]; then
color="{= rk}"
cap_color="{= rk}"
elif [ "$rem" -lt "$warn" ]; then
color="{= yk}"
cap_color="{= yk}"
else
color="{= Gk}"
cap_color="{= Gk}"
fi
@ -83,5 +83,5 @@ for bat in $BATS; do
;;
esac
printf "\005%s%d%%|%s|\005{-} " "$color" "$percent" "$sign"
printf "\005%s%d%%|%s|\005{-} " "$cap_color" "$percent" "$sign"
done

View file

@ -24,10 +24,10 @@ grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | awk -F"[:.]" '{print $2}'` || mhz=`grep -m 1 "^clock" /proc/cpuinfo | awk -F"[:.]" '{print $2}'`
if [ $mhz -ge 1000 ]; then
speed=$(echo $mhz | awk '{ printf "%.2f", $1 / 1000 }')
speed=$(echo $mhz | awk '{ printf "%.1f", $1 / 1000 }')
unit="GHz"
else
speed="$mhz"
unit="MHz"
fi
printf "\005{=b cW}%s\005{-}\005{= cW}$unit\005{-} " $mhz
printf "\005{=b cW}%s\005{-}\005{= cW}$unit\005{-} " $speed