diff --git a/byobu-status b/byobu-status index 361b7ed8..c4192fed 100755 --- a/byobu-status +++ b/byobu-status @@ -19,32 +19,19 @@ PKG="byobu" -migrate() { - OLDPKG="screen-profiles" - # Rename the config dir - mv "$HOME/.$OLDPKG" "$HOME/.$PKG" - ln -s "$HOME/.$PKG" "$HOME/.$OLDPKG" - # Replace all instances of the old package name with the new - find "$HOME/.$PKG" -type f | xargs sed -i "s/$OLDPKG/$PKG/g" - # Fix the chosen profile symlink - if [ -h "$HOME/.$PKG/profile" ]; then - # Determine the chosen profile color - profile=`stat "$HOME/.$PKG/profile" | head -n1 | sed "s:^.*[/-]::" | sed "s:'$::"` - # Try to set that color, if it exists, otherwise default to light - select-screen-profile -s "$profile" || select-screen-profile -s "light" - fi +find_script () { + # Allow for local status scripts + if [ -x "$HOME/.$PKG/bin/$1" ]; then + echo "$HOME/.$PKG/bin/$1" + elif [ -x "/usr/lib/$PKG/$1" ]; then + echo "/usr/lib/$PKG/$1" + else + echo "/bin/true" + fi } -# If the old config dir exists, but the new one doesn't, provide a migration mechanism. -[ -d "$HOME/.$OLDPKG" ] && [ ! -d "$HOME/.$PKG" ] && migrate - -# Allow for local status scripts -DIR="/usr/lib/$PKG" -[ -d "$HOME/.$PKG/bin" ] && DIR="$HOME/.$PKG/bin" - -# Source global status configuration +# Source configuration [ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc" -# Source local status configuration [ -r "$HOME/.$PKG/status" ] && . "$HOME/.$PKG/status" export P="$1" @@ -56,13 +43,14 @@ if [ "$P" = "--detail" ]; then printf "$PKG$VER Detailed Status Navigation\n Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n" for i in `ls "$DIR"`; do [ "$i" = "menu" ] && continue - short=`"$DIR"/$i --short | sed 's/^\s*//' | sed 's/\s*$//' | sed 's/.{[^}]*}//g'` || true - detail=`"$DIR"/$i --detail | sed '/^$/d' | sed 's/^/\t/g'` || true + script=`find_script $i` + short=`$script --short | sed 's/^\s*//' | sed 's/\s*$//' | sed 's/.{[^}]*}//g'` || true + detail=`$script --detail | sed '/^$/d' | sed 's/^/\t/g'` || true printf "%s\n\t(%s)\n" "$short" "$i" [ -n "$detail" ] && printf "%s\n" "$detail" done else eval x=\$$P || exit 1 [ "$x" = "1" ] || exit 0 - [ -x "$DIR/$P" ] && exec "$DIR/$P" + exec $(find_script "$P") fi diff --git a/debian/changelog b/debian/changelog index 8db488a3..fe31e920 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,11 +10,14 @@ byobu (2.13) unreleased; urgency=low status states, rather than the big case statement, performance improvement for all status, also reduces the number of places to touch when a new status script is added + * byobu-status: move all of the cleanup hacks to byobu-janitor; create + a find_script() function that allows for scripts in both /usr/lib and + $HOME/.byobu [ Ciemon Dunville ] * byobu.1: reflect the keybinding toggle change to Ctrl-a-! - -- Dustin Kirkland Fri, 19 Jun 2009 16:21:27 -0500 + -- Dustin Kirkland Fri, 19 Jun 2009 17:50:59 -0500 byobu (2.12-0ubuntu1) karmic; urgency=low