mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
bold numbers, leave units un-bold
This commit is contained in:
parent
cece22d7d5
commit
8f5a2ce067
3 changed files with 9 additions and 6 deletions
|
@ -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"
|
||||
|
|
|
@ -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)}'
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue