bold numbers, leave units un-bold

This commit is contained in:
Dustin Kirkland 2009-04-06 11:51:17 -07:00
commit 8f5a2ce067
3 changed files with 9 additions and 6 deletions

View file

@ -26,10 +26,13 @@ grep -qs "^mem-used=1$" "$HOME/.screen-profiles/status" && comma="," || whitespa
mem=`free | grep -m 1 "^Mem:" | awk '{print $2}'`
if [ $mem -ge 1048576 ]; then
mem=$(echo "$mem" | awk '{ printf "%.1fGB", $1 / 1048576 }')
mem=$(echo "$mem" | awk '{ printf "%.1f", $1 / 1048576 }')
unit="GB"
elif [ $mem -ge 1024 ]; then
mem=$(echo "$mem" | awk '{ printf "%.0fMB", $1 / 1024 }')
mem=$(echo "$mem" | awk '{ printf "%.0f", $1 / 1024 }')
unit="MB"
else
mem="$mem""KB"
mem="$mem"
unit="KB"
fi
printf "\005{= gW}%s\005{-}%s" "$mem$comma" "$whitespace"
printf "\005{=b gW}%s\005{-}\005{= gW}$unit$comma\005{-}%s" "$mem" "$whitespace"

View file

@ -21,4 +21,4 @@
p="mem-used"
grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
free | awk '/buffers\/cache:/ {printf "\005{= gW}%.0f%%\005{-} ", 100*$3/($3 + $4)}'
free | awk '/buffers\/cache:/ {printf "\005{=b gW}%.0f\005{-}\005{= gW}%%\005{-} ", 100*$3/($3 + $4)}'

View file

@ -21,4 +21,4 @@
p="processes"
grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0
printf "\005{= yk}%s&\005{-} " $(ps -e | wc -l)
printf "\005{=b yk}%s\005{-}\005{= yk}&\005{-} " $(ps -e | wc -l)