* 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


Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-08-17 13:20:17 -05:00
commit 78cbcca5f4
8 changed files with 36 additions and 17 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

7
debian/changelog vendored
View file

@ -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 <kirkland@ubuntu.com> Wed, 05 Aug 2009 16:31:00 +0100
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 17 Aug 2009 13:19:50 -0500
byobu (2.25-0ubuntu1) karmic; urgency=low