diff --git a/bin/apport b/bin/apport
index 530e76a7..8427c18b 100755
--- a/bin/apport
+++ b/bin/apport
@@ -17,11 +17,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
if ls /var/crash/*.crash >/dev/null 2>&1; then
printf "\nTo file bugs on the existing crash reports, run:\n"
which apport-cli >/dev/null || printf " sudo apt-get install apport\n"
- fi
for i in /var/crash/*.crash; do
printf " apport-cli $i\n"
done
@@ -34,4 +36,4 @@ if [ "$1" = "--detail" ]; then
fi
# Print {!} if a /var/crash/*.crash file exists
-ls /var/crash/*.crash >/dev/null 2>&1 && printf "\005{= yk}{!}\005{-} "
+ls /var/crash/*.crash >/dev/null 2>&1 && printf "$yk{!}$UNDO "
diff --git a/bin/battery b/bin/battery
index 8bf3c380..405d537f 100755
--- a/bin/battery
+++ b/bin/battery
@@ -18,6 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
search () {
local str expr
@@ -48,11 +50,14 @@ 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"
+ color="$Rk"
+ bcolor="$bRk"
elif [ "$percent" -lt 67 ]; then
- per_color="Yk"
+ color="$Yk"
+ bcolor="$bYk"
else
- per_color="Gk"
+ color="$Gk"
+ bcolor="$bGk"
fi
percent="$percent%"
@@ -72,6 +77,6 @@ for bat in $(ls /proc/acpi/battery); do
sign="$state"
;;
esac
- printf "\005{=b %s}%s\005{-}\005{= %s}|%s|\005{-} " "$per_color" "$percent" "$per_color" "$sign"
+ printf "$bcolor%s$UNDO$color|%s|$UNDO " "$percent" "$sign"
break
done
diff --git a/bin/cpu_freq b/bin/cpu_freq
index 55cb0ed4..c9e619a6 100755
--- a/bin/cpu_freq
+++ b/bin/cpu_freq
@@ -17,13 +17,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
cat /proc/cpuinfo
exit 0
fi
if [ -r "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ]; then
- awk '{ printf "\005{=b cW}%.1f\005{-}\005{= cW}GHz\005{-} ", $1 / 1000000 }' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
+ freq=$(awk '{ printf "%.1f", $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}%.1f\005{-}\005{= cW}GHz\005{-} ", $2 / 1000 }'
+ freq=$(egrep -i -m 1 "^cpu MHz|^clock|^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ printf "%.1f", $2 / 1000 }')
fi
+printf "$bcW%s$UNDO$cW%s$UNDO " "$freq" "GHz"
diff --git a/bin/disk b/bin/disk
index 4e93afe2..219e53f8 100755
--- a/bin/disk
+++ b/bin/disk
@@ -18,6 +18,7 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
if [ "$1" = "--detail" ]; then
df -h -P
@@ -28,8 +29,9 @@ fi
MP="/"
[ -n "$MONITORED_DISK" ] && MP="$MONITORED_DISK"
case $MP in
- /dev/*) MP=`grep "$MP" /proc/mounts | awk '{print $2}'` ;;
+ /dev/*) MP=$(grep "$MP" /proc/mounts | awk '{print $2}') ;;
esac
-disk=`df -h -P "$MP" 2>/dev/null || df -h "$MP"`
-echo "$disk" | tail -n 1 | awk '{print $2 " " $5}' | sed "s/\([^0-9\. ]\)/ \1/g" | awk '{printf "\005{=b MW}%d\005{-}\005{= MW}%sB,\005{-}\005{=b MW}%d\005{-}\005{= MW}%%\005{-} ", $1, $2, $3}'
+disk=$(df -h -P "$MP" 2>/dev/null || df -h "$MP")
+disk=$(echo "$disk" | tail -n 1 | awk '{print $2 " " $5}' | sed "s/\([^0-9\. ]\)/ \1/g" | awk '{printf "%d%sB,%d%", $1, $2, $3}')
+printf "$MW%s$UNDO " "$disk"
diff --git a/bin/ec2_cost b/bin/ec2_cost
index 7ab8d460..19b7d7b5 100755
--- a/bin/ec2_cost
+++ b/bin/ec2_cost
@@ -19,6 +19,7 @@
DETAIL=0
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
for arg in $@; do
case "$arg" in
@@ -82,4 +83,4 @@ if [ "$DETAIL" = "1" ]; then
exit 0
fi
-printf "\005{= KG}~\$\005{-}\005{=b KG}%s\005{-} " $total_cost
+printf "$KG~\$$UNDO$bKG%s$UNDO " $total_cost
diff --git a/bin/fan_speed b/bin/fan_speed
index c49475fa..f0684a19 100755
--- a/bin/fan_speed
+++ b/bin/fan_speed
@@ -18,6 +18,9 @@
# along with this program. If not, see .
#
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
DIR="/sys/class/hwmon"
if [ "$1" = "--detail" ]; then
for i in `ls $DIR 2>/dev/null`; do
@@ -30,7 +33,7 @@ fi
for i in $(find $DIR/*/*/ -type f -name "fan1_input"); do
speed=$(cat "$i")
if [ "$speed" -gt 0 ]; then
- printf "\005{=b }%s\005{-}\005{= }rpm\005{-} " "$speed"
+ printf "$BOLD1%s$UNDO$NONE%s$UNDO " "$speed" "rpm"
exit 0
fi
done
diff --git a/bin/hostname b/bin/hostname
index cfac02bd..125ed863 100755
--- a/bin/hostname
+++ b/bin/hostname
@@ -18,6 +18,7 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
if [ "$1" = "--detail" ]; then
hostname -f
@@ -28,4 +29,4 @@ fi
. "$HOME/.$PKG/status"
[ "$whoami" = "1" ] && at="@"
-printf "\005{+b }%s%s\005{-}" "$at" $(hostname -s 2>/dev/null || hostname)
+printf "$BOLD2%s%s$UNDO" "$at" $(hostname -s 2>/dev/null || hostname)
diff --git a/bin/ip_address b/bin/ip_address
index 947b257f..3e633b69 100755
--- a/bin/ip_address
+++ b/bin/ip_address
@@ -18,6 +18,7 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
if [ "$1" = "--detail" ]; then
/sbin/ifconfig | grep "inet addr" | sed -e 's/^\s*//' -e 's/\s*$//'
@@ -38,4 +39,4 @@ fi
ipaddr=`/sbin/ifconfig "$interface" | grep "inet addr:" | sed -e "s/^.*inet addr://" -e "s/ .*$//"`
-printf "%s\005{+b }%s\005{-}" "$space" "$ipaddr"
+printf "%s$BOLD2%s$UNDO" "$space" "$ipaddr"
diff --git a/bin/load_average b/bin/load_average
index 280fa695..b2224e1a 100755
--- a/bin/load_average
+++ b/bin/load_average
@@ -17,9 +17,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
cat /proc/loadavg
exit 0
fi
-printf "\005{= Yk}%s\005{-} " $(awk '{print $1}' /proc/loadavg)
+printf "$Yk%s$UNDO " $(awk '{print $1}' /proc/loadavg)
diff --git a/bin/logo b/bin/logo
index bce20ff9..6f9ee108 100755
--- a/bin/logo
+++ b/bin/logo
@@ -18,6 +18,7 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
if [ "$1" = "--detail" ]; then
MARKUP="false"
@@ -30,63 +31,63 @@ print_logo() {
distro=`echo "$1" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' `
case "$distro" in
*ubuntu*)
- $MARKUP && printf "\005{=b kr}\\\\\005{= ky}o\005{=b kY}/" || printf "\\o/"
+ $MARKUP && printf "$bkr%s$ky%s$bkY%s" "\\" "o" "/" || printf "\\o/"
;;
*altlinux*)
logo="alt"
- $MARKUP && printf "\005{= Yk}$logo" || printf "$logo"
+ $MARKUP && printf "$Yk%s" "$logo" || printf "$logo"
;;
*arch*)
logo=" A "
- $MARKUP && printf "\005{=b wb}$logo" || printf "$logo"
+ $MARKUP && printf "$bwb%s" "$logo" || printf "$logo"
;;
*centos*)
logo="****"
- $MARKUP && printf "\005{= gw}*\005{= mw}*\005{= yw}*\005{= bw}*\005{=b Wk}" || printf "$logo"
+ $MARKUP && printf "$gw*$mw*$yw*$bw*" || printf "$logo"
;;
*debian*)
logo=" @ "
- $MARKUP && printf "\005{= wr}$logo" || printf "$logo"
+ $MARKUP && printf "$wr%s" "$logo" || printf "$logo"
;;
*fedora*)
logo=" f "
- $MARKUP && printf "\005{=b bw}$logo" || printf "$logo"
+ $MARKUP && printf "$bw%s" "$logo" || printf "$logo"
;;
*foresight*)
logo="<@>"
- $MARKUP && printf "\005{=b Wg}$logo" || printf "$logo"
+ $MARKUP && printf "$bWg%s" "$logo" || printf "$logo"
;;
*gentoo*)
logo=" > "
- $MARKUP && printf "\005{=b cw}$logo" || printf "$logo"
+ $MARKUP && printf "$bcw%s" "$logo" || printf "$logo"
;;
*mandriva*)
logo=" (* "
- $MARKUP && printf "\005{=b kc} (\005{=b ky}* " || printf "$logo"
+ $MARKUP && printf "$bkc ($bky* " || printf "$logo"
;;
*redhat*)
logo=" RH "
- $MARKUP && printf "\005{= Rk}$logo" || printf "$logo"
+ $MARKUP && printf "$Rk%s" "$logo" || printf "$logo"
;;
*rockhopper*)
logo="palm"
- $MARKUP && printf "\005{=b YW}$logo" || printf "$logo"
+ $MARKUP && printf "$kw%s" "$logo" || printf "$logo"
;;
*slackware*)
- logo=",S "
- $MARKUP && printf "\005{=u Bk}$logo" || printf "$logo"
+ logo=".S "
+ $MARKUP && printf "$uBk%s" "$logo" || printf "$logo"
;;
*suse*)
logo="SuSE"
- $MARKUP && printf "\005{= Wg}$logo" || printf "$logo"
+ $MARKUP && printf "$Wg%s" "$logo" || printf "$logo"
;;
*xandros*)
logo=" X "
- $MARKUP && printf "\005{= Wr}$logo" || printf "$logo"
+ $MARKUP && printf "$Wr%s" "$logo" || printf "$logo"
;;
*)
- logo="|B|"
- $MARKUP && printf "\005{=b kW}$logo" || printf " $logo "
+ logo="[B]"
+ $MARKUP && printf "$bkW%s" "$logo" || printf " $logo "
;;
esac
}
diff --git a/bin/mail b/bin/mail
index e1fc3cb9..7421be47 100755
--- a/bin/mail
+++ b/bin/mail
@@ -17,10 +17,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
mailfile="/var/spool/mail/$USER"
if [ "$1" = "--detail" ]; then
ls -alF "$mailfile" 2>&1
exit 0
fi
-[ -s "$mailfile" ] && printf "\005{= wk}[\005{-}\005{=b wk}M\005{-}\005{= wk}]\005{-} " || exit 0
+[ -s "$mailfile" ] && printf "$wk[M]$UNDO " || exit 0
diff --git a/bin/mem_available b/bin/mem_available
index 7a5b66be..f6dd4627 100755
--- a/bin/mem_available
+++ b/bin/mem_available
@@ -18,6 +18,7 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
if [ "$1" = "--detail" ]; then
free
@@ -39,4 +40,4 @@ else
mem="$mem"
unit="KB"
fi
-printf "\005{=b gW}%s\005{-}\005{= gW}$unit%s\005{-}%s" "$mem" "$comma" "$whitespace"
+printf "$bgW%s$UNDO$gW$unit%s$UNDO%s" "$mem" "$comma" "$whitespace"
diff --git a/bin/mem_used b/bin/mem_used
index 01e4fcfc..d9911afd 100755
--- a/bin/mem_used
+++ b/bin/mem_used
@@ -17,9 +17,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
cat /proc/meminfo
exit 0
fi
-free | awk '/buffers\/cache:/ {printf "\005{=b gW}%.0f\005{-}\005{= gW}%%\005{-} ", 100*$3/($3 + $4)}'
+f=$(free | awk '/buffers\/cache:/ {printf "%.0f", 100*$3/($3 + $4)}')
+printf "$bgW%s$UNDO$gW%%$UNDO " "$f"
diff --git a/bin/menu b/bin/menu
index 79e0e11c..725da1f8 100755
--- a/bin/menu
+++ b/bin/menu
@@ -19,6 +19,7 @@
[ "$1" = "--detail" ] && exit 0
PKG="byobu"
+
[ -r "$HOME/.$PKG/keybindings"] && bindings="$HOME/.$PKG/keybindings" || bindings="$HOME/.screenrc"
if grep -qs "^source.*screen-escape-keys$" $bindings 2>/dev/null; then
@@ -30,4 +31,4 @@ else
key="F9"
fi
-printf " \005{= kw}%s:<\005{-}\005{=b kw}$key\005{= kw}>" `gettext "Menu"`
+printf " $kw%s:<$UNDO$bkw$key$kw>" `gettext "Menu"`
diff --git a/bin/network b/bin/network
index a1b54f05..f09e112e 100755
--- a/bin/network
+++ b/bin/network
@@ -18,6 +18,7 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
# Allow interface overrides in $HOME/.$PKG/status
if [ -n "$MONITORED_NETWORK" ]; then
@@ -57,5 +58,5 @@ for i in up down; do
unit="MB/s"
fi
fi
- printf "$symbol\005{=b mw}$rate\005{-}\005{= mw}$unit\005{-} "
+ printf "$symbol$bmw$rate$UNDO$mw$unit$UNDO "
done
diff --git a/bin/processes b/bin/processes
index 55dbb10a..5e9bb220 100755
--- a/bin/processes
+++ b/bin/processes
@@ -17,9 +17,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
ps -ejH
exit 0
fi
-printf "\005{=b yw}%s\005{-}\005{= yw}&\005{-} " $(ls -d /proc/[0-9]* 2>/dev/null| wc -l)
+printf "$byw%s$UNDO$yw&$UNDO " $(ls -d /proc/[0-9]* 2>/dev/null| wc -l)
diff --git a/bin/reboot_required b/bin/reboot_required
index 59b93bfd..486e1790 100755
--- a/bin/reboot_required
+++ b/bin/reboot_required
@@ -18,6 +18,8 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
reboot="/var/run/reboot-required"
[ -d "/var/run/screen/S-$USER" ] && DIR="/var/run/screen/S-$USER" || DIR="$HOME/.byobu"
reload="$DIR/$PKG.reload-required"
@@ -29,7 +31,7 @@ case "$1" in
[ -e "$reboot" ] && printf "Yes" || printf "No"
;;
*)
- [ -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{-} "
+ [ -e "$reboot" ] && printf "$bW($UNDO$bbW%s$UNDO$bW)$UNDO " "R"
+ [ -e "$reload" ] && printf "$bW<$UNDO$bbW%s$UNDO$bW>$UNDO " "F5"
;;
esac
diff --git a/bin/release b/bin/release
index 5f4d16f8..fcfab00c 100755
--- a/bin/release
+++ b/bin/release
@@ -18,6 +18,7 @@
# along with this program. If not, see .
PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
if [ "$1" = "--detail" ]; then
cat /etc/issue
@@ -54,4 +55,4 @@ else
DISTRO="Byobu"
fi
-printf "\005{+b }%s\005{-} " "$DISTRO"
+printf "$BOLD2%s$UNDO " "$DISTRO"
diff --git a/bin/temp_c b/bin/temp_c
index 4442cbad..2d9032b4 100755
--- a/bin/temp_c
+++ b/bin/temp_c
@@ -18,6 +18,9 @@
# along with this program. If not, see .
#
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
DIR="/proc/acpi/thermal_zone"
if [ "$1" = "--detail" ]; then
for i in `ls $DIR 2>/dev/null`; do
@@ -29,6 +32,6 @@ fi
for i in $MONITORED_TEMP `ls $DIR/*/temperature 2>/dev/null`; do
t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
- printf "\005{=b kY}%s\005{-}\005{= kY}\260C\005{-} " "$t"
+ printf "$bkY%s$UNDO$kY\260C$UNDO " "$t"
break
done
diff --git a/bin/temp_f b/bin/temp_f
index 0fd04078..3a265d0d 100755
--- a/bin/temp_f
+++ b/bin/temp_f
@@ -18,6 +18,9 @@
# along with this program. If not, see .
#
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
DIR="/proc/acpi/thermal_zone"
if [ "$1" = "--detail" ]; then
exit 0
@@ -25,6 +28,6 @@ fi
for i in `ls $DIR/*/temperature 2>/dev/null`; do
t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i" | awk '{printf "%.0f", $1 *9/5 + 32}')
- printf "\005{=b kY}%s\005{-}\005{= kY}\260F\005{-} " "$t"
+ printf "$bkY%s$UNDO$kY\260F$UNDO " "$t"
break
done
diff --git a/bin/updates_available b/bin/updates_available
index e976a87b..ea775e81 100755
--- a/bin/updates_available
+++ b/bin/updates_available
@@ -38,13 +38,13 @@ print_updates() {
s=$2
if [ -n "$u" ]; then
if [ "$u" -gt 0 ]; then
- printf "$brW%d$XXX$rW!" "$u"
+ printf "$brW%d$UNDO$rW!" "$u"
if [ -n "$s" ]; then
if [ "$s" -gt 0 ]; then
printf "!"
fi
fi
- printf "$XXX "
+ printf "$UNDO "
fi
fi
}
diff --git a/bin/uptime b/bin/uptime
index a3fc7dbd..cb47f88e 100755
--- a/bin/uptime
+++ b/bin/uptime
@@ -20,13 +20,16 @@
# along with this program. If not, see .
#
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
uptime
exit 0
fi
u=$(sed "s/\..*$//" /proc/uptime)
-printf "\005{= wb}"
+printf "$wb"
if [ "$u" -gt 86400 ]; then
echo "$u" | awk '{printf "%dd%dh", $1 / 86400, ($1 % 86400)/3600 }'
elif [ "$u" -gt 3600 ]; then
@@ -36,4 +39,4 @@ elif [ "$u" -gt 60 ]; then
else
printf "%ds" "$u"
fi
-printf "\005{-} "
+printf "$UNDO "
diff --git a/bin/users b/bin/users
index ed2fb877..3e9b12f2 100755
--- a/bin/users
+++ b/bin/users
@@ -20,6 +20,9 @@
# along with this program. If not, see .
#
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
ps -ef | grep "sshd;.*@" | grep -v grep
exit 0
@@ -28,4 +31,4 @@ fi
# Note: we'd like to use pgrep -c, however, this isn't available in
# busybox and some distro's pgrep (and it doesn't exit non-zero).
count=`pgrep -f "sshd:.*@" | wc -l` || exit 0
-[ $count -gt 0 ] && printf "\005{=b wr}%d\005{-}\005{= wr}#\005{-} " $count
+[ $count -gt 0 ] && printf "$bwr%d$UNDO$wr#$UNDO " $count
diff --git a/bin/whoami b/bin/whoami
index 45b9a465..6f40f7c7 100755
--- a/bin/whoami
+++ b/bin/whoami
@@ -22,4 +22,4 @@ if [ "$1" = "--detail" ]; then
exit 0
fi
-printf "\005{+b }%s\005{-}" $(whoami)
+printf "$BOLD2%s$UNDO" $(whoami)
diff --git a/bin/wifi_quality b/bin/wifi_quality
index 3e3f197d..74e267f4 100755
--- a/bin/wifi_quality
+++ b/bin/wifi_quality
@@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+PKG="byobu"
+[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
+
if [ "$1" = "--detail" ]; then
/sbin/iwconfig 2>/dev/null
exit 0
@@ -25,5 +28,5 @@ fi
iwconfig=`/sbin/iwconfig 2>/dev/null`
bitrate=`echo "$iwconfig" | grep "Bit Rate." | sed -e "s/^.*Bit Rate.//" -e "s/ .*$//g"`
[ -z "$bitrate" ] && bitrate="0"
-quality=`echo "$iwconfig" | grep "Link Quality." | sed -e "s/^.*Link Quality.//" -e "s/ .*$//g"`
-echo | awk "{printf \"\005{=b Ck}%s\005{-}\005{= Ck}Mb/s,\005{-}\005{=b Ck}%d\005{-}\005{= Ck}%%\005{-} \", $bitrate, 100*$quality}"
+quality=`echo "$iwconfig" | grep "Link Quality." | sed -e "s/^.*Link Quality.//" -e "s/ .*$//g" | awk -F/ '{printf "%.0f", 100*$1/$2}'`
+printf "$bCk%s$UNDO$Ck%s,$UNDO$bCk%s$UNDO$Ck%%$UNDO " "$bitrate" "Mbps" "$quality"
diff --git a/debian/changelog b/debian/changelog
index 76f66ec4..890b2ff8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,13 @@ byobu (2.40) unreleased; urgency=low
* bin/apport: improve the formatting of the detailed output to
suggest installing apport if necessary
* debian/control: suggest apport
+ * bin/apport, bin/battery, bin/cpu_freq, bin/disk, bin/ec2_cost,
+ bin/fan_speed, bin/hostname, bin/ip_address, bin/load_average,
+ bin/logo, bin/mail, bin/mem_available, bin/mem_used, bin/menu,
+ bin/network, bin/processes, bin/reboot_required, bin/release,
+ bin/temp_c, bin/temp_f, bin/updates_available, bin/uptime, bin/users,
+ bin/whoami, bin/wifi_quality statusrc: define a set of color variables,
+ such that it's easier to make these theme-able
-- Dustin Kirkland Tue, 10 Nov 2009 10:18:20 -0600
diff --git a/po/bg.po b/po/bg.po
index 830a5a94..02db1c13 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: screen-profiles\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-10-08 15:00+0000\n"
"Last-Translator: Dragomir Minkovski \n"
"Language-Team: Bulgarian \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-10-09 06:48+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Меню"
diff --git a/po/byobu.pot b/po/byobu.pot
index f4ae494b..5d408ef1 100644
--- a/po/byobu.pot
+++ b/po/byobu.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr ""
diff --git a/po/de.po b/po/de.po
index ae80e7dd..6f7e5121 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: screen-profiles\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-16 07:07+0000\n"
"Last-Translator: Dustin Kirkland \n"
"Language-Team: German \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr ""
diff --git a/po/en_GB.po b/po/en_GB.po
index 0c86b64c..5d9a6bc4 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: screen-profiles\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-16 07:18+0000\n"
"Last-Translator: Dave Walker \n"
"Language-Team: English (United Kingdom) \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menu"
diff --git a/po/es.po b/po/es.po
index 2b942888..d7751c50 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-10-03 23:47+0000\n"
"Last-Translator: oscrp \n"
"Language-Team: LANGUAGE \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-10-04 06:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menú"
diff --git a/po/fr.po b/po/fr.po
index 79cc66b6..1416f784 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-16 07:25+0000\n"
"Last-Translator: Pierre Slamich \n"
"Language-Team: LANGUAGE \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menu"
diff --git a/po/hu.po b/po/hu.po
index f0f047c4..7e3a464f 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: byobu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-25 09:06+0000\n"
"Last-Translator: Muszela Balázs \n"
"Language-Team: Hungarian \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-30 06:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menü"
diff --git a/po/id.po b/po/id.po
index 1d634a90..7d3d9b97 100644
--- a/po/id.po
+++ b/po/id.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: byobu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-08-17 21:09+0000\n"
"Last-Translator: Andika Triwidada \n"
"Language-Team: Indonesian \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menu"
diff --git a/po/it.po b/po/it.po
index a31a4d80..4271dd91 100644
--- a/po/it.po
+++ b/po/it.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: byobu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-16 07:42+0000\n"
"Last-Translator: Dustin Kirkland \n"
"Language-Team: Italian \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menu"
diff --git a/po/ja.po b/po/ja.po
index 3fa1d1d7..5b79e528 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: screen-profiles\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-16 07:43+0000\n"
"Last-Translator: Fumihito YOSHIDA \n"
"Language-Team: Japanese \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr ""
diff --git a/po/la.po b/po/la.po
index c5ecc78e..c162f977 100644
--- a/po/la.po
+++ b/po/la.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: screen-profiles\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-16 07:46+0000\n"
"Last-Translator: Dustin Kirkland \n"
"Language-Team: Latin \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr ""
diff --git a/po/nl.po b/po/nl.po
index 1444d004..284c04e3 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: byobu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-21 10:12+0000\n"
"Last-Translator: Dustin Kirkland \n"
"Language-Team: Dutch \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr ""
diff --git a/po/pt.po b/po/pt.po
index 926d8165..c711f534 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: byobu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-09-16 10:59+0000\n"
"Last-Translator: Bruno Vitorino \n"
"Language-Team: Portuguese \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menu"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index dfc17a6a..873322bb 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: byobu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-10-06 12:33+0000\n"
"Last-Translator: slowtux \n"
"Language-Team: Brazilian Portuguese \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-10-07 06:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Menu"
diff --git a/po/ru.po b/po/ru.po
index 49cc8186..3a42ce67 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ru\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-07-24 14:46+0000\n"
"Last-Translator: byobu \n"
"Language-Team: \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-09-23 11:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Меню"
diff --git a/po/sv.po b/po/sv.po
index 2968f12e..2c6061d5 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: byobu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-23 19:35-0600\n"
+"POT-Creation-Date: 2009-11-23 20:48-0600\n"
"PO-Revision-Date: 2009-10-05 12:56+0000\n"
"Last-Translator: Carl-Uno Olsson \n"
"Language-Team: Swedish \n"
@@ -17,7 +17,7 @@ msgstr ""
"X-Launchpad-Export-Date: 2009-10-06 06:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: bin/menu:33 byobu-config:129 byobu-config:401 byobu-config:409
+#: bin/menu:34 byobu-config:129 byobu-config:401 byobu-config:409
msgid "Menu"
msgstr "Meny"
diff --git a/statusrc b/statusrc
index b466f9c0..49fde1fe 100644
--- a/statusrc
+++ b/statusrc
@@ -49,6 +49,60 @@ whoami=0
wifi_quality=0
# Define colors
-XXX="\005{-}"
-brW="\005{=b rW}"
-rW="\005{= rW}"
+ESC="\005"
+UNDO="$ESC{-}"
+BOLD1="$ESC{=b }"
+BOLD2="$ESC{+b }"
+NONE="$ESC{= }"
+
+bw="$ESC{= bw}"
+bW="$ESC{= bW}"
+cW="$ESC{= cW}"
+gw="$ESC{= gw}"
+gW="$ESC{= gW}"
+mw="$ESC{= mw}"
+rW="$ESC{= rW}"
+kw="$ESC{= kw}"
+ky="$ESC{= ky}"
+kY="$ESC{= kY}"
+wb="$ESC{= wb}"
+wk="$ESC{= wk}"
+wr="$ESC{= wr}"
+yk="$ESC{= yk}"
+yw="$ESC{= yw}"
+
+Ck="$ESC{= Ck}"
+Gk="$ESC{= Gk}"
+KG="$ESC{= KG}"
+MW="$ESC{= MW}"
+Rk="$ESC{= Rk}"
+Wg="$ESC{= Wg}"
+Wr="$ESC{= Wr}"
+Yk="$ESC{= Yk}"
+
+bbW="$ESC{=b bW}"
+bcw="$ESC{=b cw}"
+bcW="$ESC{=b cW}"
+bgW="$ESC{=b gW}"
+bky="$ESC{=b ky}"
+bkY="$ESC{=b kY}"
+bkc="$ESC{=b kc}"
+bkr="$ESC{=b kr}"
+bkY="$ESC{=b kY}"
+bkw="$ESC{=b kw}"
+bkW="$ESC{=b kW}"
+bmw="$ESC{=b mw}"
+brW="$ESC{=b rW}"
+bwb="$ESC{=b wb}"
+bwr="$ESC{=b wr}"
+byw="$ESC{=b yw}"
+bCk="$ESC{=b Ck}"
+bGk="$ESC{=b Gk}"
+bKG="$ESC{=b KG}"
+bMW="$ESC{=b MW}"
+bRk="$ESC{=b Rk}"
+bWg="$ESC{=b Wg}"
+bWk="$ESC{=b Wk}"
+bYk="$ESC{=b Yk}"
+
+uBk="$ESC{=u Bk}"