diff --git a/bin/battery b/bin/battery index b16af493..8bf3c380 100755 --- a/bin/battery +++ b/bin/battery @@ -48,11 +48,11 @@ for bat in $(ls /proc/acpi/battery); do percent=$( echo "$rem" "$full" | awk '{printf "%.0f", 100*$1/$2}') if [ "$percent" -lt 33 ]; then - per_color="{= Rk}" + per_color="Rk" elif [ "$percent" -lt 67 ]; then - per_color="{= Yk}" + per_color="Yk" else - per_color="{= Gk}" + per_color="Gk" fi percent="$percent%" @@ -72,6 +72,6 @@ for bat in $(ls /proc/acpi/battery); do sign="$state" ;; esac - printf "\005%s%s|%s|\005{-} " "$per_color" "$percent" "$sign" + printf "\005{=b %s}%s\005{-}\005{= %s}|%s|\005{-} " "$per_color" "$percent" "$per_color" "$sign" break done diff --git a/bin/cpu_freq b/bin/cpu_freq index 3def2500..55cb0ed4 100755 --- a/bin/cpu_freq +++ b/bin/cpu_freq @@ -23,7 +23,7 @@ if [ "$1" = "--detail" ]; then fi if [ -r "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ]; then - awk '{ printf "\005{=b cW}%.1fGHz\005{-} ", $1 / 1000000 }' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq + awk '{ printf "\005{=b cW}%.1f\005{-}\005{= cW}GHz\005{-} ", $1 / 1000000 }' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq else - egrep -i -m 1 "^cpu MHz|^clock|^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ printf "\005{=b cW}%.1fGHz\005{-} ", $2 / 1000 }' + egrep -i -m 1 "^cpu MHz|^clock|^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ printf "\005{=b cW}%.1f\005{-}\005{= cW}GHz\005{-} ", $2 / 1000 }' fi diff --git a/bin/disk b/bin/disk index 3a786780..1058def9 100755 --- a/bin/disk +++ b/bin/disk @@ -1,6 +1,6 @@ #!/bin/sh -e # -# disk_available: print the current disk space available +# disk: print the current disk space and usage # Copyright (C) 2008 Canonical Ltd. # # Authors: Dustin Kirkland @@ -30,4 +30,4 @@ case $MP in /dev/*) MP=`grep "$MP" /proc/mounts | awk '{print $2}'` ;; esac -df -h -P "$MP" | tail -n 1 | awk '{printf "\005{=b MW}%sB,%s\005{-} ", $2, $5}' +df -h -P "$MP" | tail -n 1 | awk '{printf "\005{=b MW}%sB\005{-}\005{= MW},%s\005{-} ", $2, $5}' diff --git a/bin/ec2_cost b/bin/ec2_cost index 5e2e9af4..7ab8d460 100755 --- a/bin/ec2_cost +++ b/bin/ec2_cost @@ -64,7 +64,7 @@ network_cost=`echo "$tx_gb" "$TX_RATE" "$rx_gb" "$RX_RATE" | awk '{printf "%f %f # Some additional input will be required to account for reboots!!! hours=`awk '{printf "%f", 1 + $1 / 60 / 60 }' /proc/uptime | sed 's/\..*$//' ` uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$CPU_RATE" * $hours}"` -total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "~\$%.2f", $1 + $2}'` +total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'` if [ "$DETAIL" = "1" ]; then echo "================================================" @@ -77,9 +77,9 @@ if [ "$DETAIL" = "1" ]; then echo " Uptime: $hours hr @ \$$CPU_RATE/hr" echo " Uptime cost: \$$uptime_cost" echo "------------------------------------------------" - echo "Total cost: $total_cost" + echo "Total cost: ~\$$total_cost" echo "================================================" exit 0 fi -printf "\005{= wg}%s\005{-} " $total_cost +printf "\005{= KG}~\$\005{-}\005{=b KG}%s\005{-} " $total_cost diff --git a/bin/logo b/bin/logo index 8f92d2b6..1758e384 100755 --- a/bin/logo +++ b/bin/logo @@ -81,7 +81,8 @@ print_logo() { $MARKUP && printf "\005{= Wr}$logo" || printf "$logo" ;; *) - false + logo=" 屏風 " + $MARKUP && printf "\005{= Wk}$logo" || printf " $logo " ;; esac } diff --git a/bin/mail b/bin/mail index 83859896..e1fc3cb9 100755 --- a/bin/mail +++ b/bin/mail @@ -23,4 +23,4 @@ if [ "$1" = "--detail" ]; then exit 0 fi -[ -s "$mailfile" ] && printf "\005{= wk}[M]\005{-} " || exit 0 +[ -s "$mailfile" ] && printf "\005{= wk}[\005{-}\005{=b wk}M\005{-}\005{= wk}]\005{-} " || exit 0 diff --git a/bin/mem_available b/bin/mem_available index 032aba70..3d3aa460 100755 --- a/bin/mem_available +++ b/bin/mem_available @@ -1,6 +1,6 @@ #!/bin/sh -e # -# mem_available: grab the current memory available +# mem: grab the current memory and usage # Copyright (C) 2008 Canonical Ltd. # # Authors: Dustin Kirkland @@ -39,4 +39,4 @@ else mem="$mem" unit="KB" fi -printf "\005{=b gW}%s$unit%s\005{-}%s" "$mem" "$comma" "$whitespace" +printf "\005{=b gW}%s\005{-}\005{= gW}$unit%s\005{-}%s" "$mem" "$comma" "$whitespace" diff --git a/bin/mem_used b/bin/mem_used index 6f2aeeba..355a92fd 100755 --- a/bin/mem_used +++ b/bin/mem_used @@ -22,4 +22,4 @@ if [ "$1" = "--detail" ]; then exit 0 fi -free | awk '/buffers\/cache:/ {printf "\005{=b gW}%.0f%%\005{-} ", 100*$3/($3 + $4)}' +free | awk '/buffers\/cache:/ {printf "\005{=b gW}%.0f\005{-}\005{= gW}%%\005{-} ", 100*$3/($3 + $4)}' diff --git a/bin/menu b/bin/menu index 1f394049..6540c864 100755 --- a/bin/menu +++ b/bin/menu @@ -19,4 +19,4 @@ [ "$1" = "--detail" ] && exit 0 -printf " \005{= kw}%s" `gettext "Menu:"` +printf " \005{= kw}%s:<\005{-}\005{=b kw}F9\005{= kw}>" `gettext "Menu"` diff --git a/bin/processes b/bin/processes index 08a295db..0ee6d889 100755 --- a/bin/processes +++ b/bin/processes @@ -22,4 +22,4 @@ if [ "$1" = "--detail" ]; then exit 0 fi -printf "\005{= yk}%s&\005{-} " $(ls -d /proc/[0-9]* 2>/dev/null| wc -l) +printf "\005{=b yk}%s\005{-}\005{= yk}&\005{-} " $(ls -d /proc/[0-9]* 2>/dev/null| wc -l) diff --git a/bin/reboot_required b/bin/reboot_required index 2e95c481..cde59763 100755 --- a/bin/reboot_required +++ b/bin/reboot_required @@ -28,7 +28,7 @@ case "$1" in [ -e "$reboot" ] && printf "Yes" || printf "No" ;; *) - [ -e "$reboot" ] && printf "\005{=b bW}(@)\005{-} " - [ -e "$reload" ] && printf "\005{=b bW}\005{-} " + [ -e "$reboot" ] && printf "\005{= bW}(\005{-}\005{=b bW}R\005{-}\005{= bW})\005{-} " + [ -e "$reload" ] && printf "\005{= bW}<\005{-}\005{=b bW}F5\005{-}\005{= bW}>\005{-} " ;; esac diff --git a/bin/temp_c b/bin/temp_c index 491ef9fe..e6efb6f1 100755 --- a/bin/temp_c +++ b/bin/temp_c @@ -29,6 +29,6 @@ fi for i in `ls "$DIR/"*"/temperature"`; do t=$(sed "s/^[^0-9]\+//" "$i" | sed "s/\s.*$//") - printf "\005{=b kY}%sC\005{-} " "$t" + printf "\005{=b kY}%s\005{-}\005{= kY}C\005{-} " "$t" break done diff --git a/bin/temp_f b/bin/temp_f index 00841a0a..0a767953 100755 --- a/bin/temp_f +++ b/bin/temp_f @@ -25,6 +25,6 @@ fi for i in `ls "$DIR/"*"/temperature"`; do t=$(sed "s/^[^0-9]\+//" "$i" | sed "s/\s.*$//" | awk '{printf "%.0f", $1 *9/5 + 32}') - printf "\005{=b kY}%sF\005{-} " "$t" + printf "\005{=b kY}%s\005{-}\005{= kY}F\005{-} " "$t" break done diff --git a/bin/updates_available b/bin/updates_available index efdda87d..56a848b9 100755 --- a/bin/updates_available +++ b/bin/updates_available @@ -40,7 +40,7 @@ print_updates() { s=$2 if [ -n "$u" ]; then if [ "$u" -gt 0 ]; then - printf "\005{=b rW}%d!" "$u" + printf "\005{=b rW}%d\005{-}\005{= rW}!" "$u" if [ -n "$s" ]; then if [ "$s" -gt 0 ]; then printf "!" diff --git a/bin/users b/bin/users index 64da9745..84f19f79 100755 --- a/bin/users +++ b/bin/users @@ -25,4 +25,4 @@ if [ "$1" = "--detail" ]; then exit 0 fi -printf "\005{= wr}%d#\005{-} " `pgrep -c -f "sshd:.*@"` +printf "\005{=b wr}%d\005{-}\005{= wr}#\005{-} " `pgrep -c -f "sshd:.*@"` diff --git a/debian/changelog b/debian/changelog index e0810a45..f1169132 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ byobu (2.19) unreleased; urgency=low * bin/cpu_freq, bin/disk, bin/mem_available, bin/mem_used: use bold font for these, to help with dark colored tty's * bin/temp_c, bin/temp_f: fix display of yellow on dark tty's + * bin/*: use bold for measurements, and non-bold for units; this really + makes byobu's status items 'pop'! - -- Dustin Kirkland Thu, 02 Jul 2009 16:02:09 -0700 + -- Dustin Kirkland Fri, 03 Jul 2009 15:46:49 -0700 byobu (2.18-0ubuntu1) karmic; urgency=low