diff --git a/bin/disk b/bin/disk index 812a5862..1ee24ed4 100755 --- a/bin/disk +++ b/bin/disk @@ -25,7 +25,7 @@ if [ "$1" = "--detail" ]; then fi # Default to /, but let users override -[ -r "$HOME/.$PKG/disk" ] && MP=`cat "$HOME/.$PKG/disk"` || MP="/" +[ -n "$MONITORED_DISK" ] || MP="/" case $MP in /dev/*) MP=`grep "$MP" /proc/mounts | awk '{print $2}'` ;; esac diff --git a/bin/logo b/bin/logo index 1d38c857..0a643135 100755 --- a/bin/logo +++ b/bin/logo @@ -87,15 +87,14 @@ print_logo() { esac } -if [ -r "$HOME/.$PKG/logo" ]; then - # Allow users to define their own logo - cat "$HOME/.$PKG/logo" && exit 0 || true +if [ -n "$LOGO" ]; then + # Allow users to define their own logo in $HOME/.$PKG/status + printf "%s" "$LOGO" && exit 0 || true fi -if [ -r "$HOME/.$PKG/distro" ]; then - # Allow manual override of distro - distro=`cat "$HOME/.$PKG/distro"` - print_logo "$distro" && exit 0 || true +if [ -n "$DISTRO" ]; then + # Allow manual override of distro in $HOME/.$PKG/status + print_logo "$DISTRO" && exit 0 || true fi if [ -r "/etc/issue" ]; then diff --git a/bin/network b/bin/network index f9347757..fc54d71a 100755 --- a/bin/network +++ b/bin/network @@ -19,9 +19,9 @@ PKG="byobu" -# Allow interface overrides in configuration directory -if [ -r "$HOME/.$PKG/network" ]; then - interface=`cat "$HOME/.$PKG/network"` +# Allow interface overrides in $HOME/.$PKG/status +if [ -n "$MONITORED_NETWORK" ]; then + interface="$MONITORED_NETWORK" else interface=`tail -n1 /proc/net/route | awk '{print $1}'` fi diff --git a/bin/release b/bin/release index 1cffc415..a1a3f0e6 100755 --- a/bin/release +++ b/bin/release @@ -19,8 +19,8 @@ PKG="byobu" -if [ -r "$HOME/.$PKG/distro" ]; then - printf "\005{+b }%s\005{-} " `cat "$HOME/.$PKG/distro"` +if [ -n "$DISTRO" ]; then + printf "\005{+b }%s\005{-} " "$DISTRO" elif which lsb_release >/dev/null 2>&1; then if [ "$1" = "--detail" ]; then lsb_release -a 2>/dev/null diff --git a/bin/temp_c b/bin/temp_c index fed024a4..65416a54 100755 --- a/bin/temp_c +++ b/bin/temp_c @@ -27,7 +27,7 @@ if [ "$1" = "--detail" ]; then exit 0 fi -for i in `ls "$DIR/"*"/temperature"`; do +for i in `ls $DIR/*/temperature`; do t=$(sed "s/^[^0-9]\+//" "$i" | sed "s/\s.*$//") printf "\005{=b kY}%s\005{-}\005{= kY}\260C\005{-} " "$t" break diff --git a/bin/temp_f b/bin/temp_f index 0dd9a1f4..3f9faea7 100755 --- a/bin/temp_f +++ b/bin/temp_f @@ -23,7 +23,7 @@ if [ "$1" = "--detail" ]; then exit 0 fi -for i in `ls "$DIR/"*"/temperature"`; do +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}%s\005{-}\005{= kY}\260F\005{-} " "$t" break diff --git a/byobu-janitor b/byobu-janitor index 161bdb73..83ab67cb 100755 --- a/byobu-janitor +++ b/byobu-janitor @@ -80,5 +80,22 @@ if grep -qs "screen-launcher$" "$HOME/.profile"; then /usr/share/$PKG/byobu-launcher-install fi +# Affects: Upgrades from <= byobu-2.25 +# Collapse separate status config files into the sourced config +for i in disk network distro logo; do + if [ -r "$HOME/.$PKG/$i" ]; then + val=`cat $HOME/.$PKG/$i` + uc=`echo "$i" | tr "[:lower:]" "[:upper:]"` + case $i in + disk|network) + key="MONITORED_"$uc ;; + distro|logo) + key="$uc" ;; + esac + echo "$key=\"$val\"" >> "$HOME/.$PKG/status" + rm "$HOME/.$PKG/$i" + fi +done + # Clean up flag rm -f "$FLAG" diff --git a/debian/changelog b/debian/changelog index 1e1c5a1b..fa46723a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,11 @@ byobu (2.26) unreleased; urgency=low - * UNRELEASED + * bin/temp_c, bin/temp_f: fix temperature listing + * bin/disk, bin/logo, bin/network, bin/release, bin/temp_c, bin/temp_f, + byobu-janitor: move config files to sourced config file, use + janitor item to clean up - -- Dustin Kirkland Wed, 05 Aug 2009 16:31:00 +0100 + -- Dustin Kirkland Mon, 17 Aug 2009 13:19:50 -0500 byobu (2.25-0ubuntu1) karmic; urgency=low