diff --git a/debian/changelog b/debian/changelog index 05541ca1..e46035a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -byobu (2.74-0ubuntu1) maverick; urgency=low +byobu (2.74) unreleased; urgency=low * usr/lib/byobu/disk_io: fix regex to support RAID devices, LP: #572855 * debian/postinst: make debconf question failsafe, LP: #569041 - * usr/bin/byobu: add support for different window sets, LP: #517796 + * usr/bin/byobu, usr/share/byobu/profiles/byoburc: add support for + different window sets, LP: #517796 * usr/bin/byobu-select-session: use screen -ls, less overhead -- Dustin Kirkland Wed, 28 Apr 2010 23:11:14 -0500 diff --git a/usr/bin/byobu b/usr/bin/byobu index 4b0bdcaa..1a9b6654 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -20,24 +20,12 @@ PKG="byobu" VERSION=2.74 -while [ ! -z "$1" ]; do - case "$1" in - -v|--version) - echo "$PKG version $VERSION" - screen -v - exit 0 - ;; - --windows) - if [ -r "$2" ]; then - WINDOWS=$(cat "$2") - fi - shift 2 - ;; - *) - ARGS="$ARGS $1" - ;; - esac -done +# Add a version argument for debugging purposes +if [ "$#" = "1" ] && [ "$1" = "-v" ]; then + echo "$PKG version $VERSION" + screen -v + exit 0 +fi # Check if we're being autolaunched, and this user explicitly does not want it. if [ "$0" = "/etc/profile.d/Z98-$PKG.sh" ] && [ -r "$HOME/.$PKG/disable-autolaunch" ]; then @@ -50,16 +38,17 @@ byobu-janitor --force # Set window title until https://bugs.launchpad.net/bugs/338722 is fixed in screen printf "\033]0;${USER}@$(hostname) - ${PKG}\007" -# Configure default windows DEFAULT_WINDOW= -if [ -n "$WINDOWS" ]; - mv -f "$HOME/.byobu/windows" "$HOME/.byobu/.windows-swap" - cleanup='mv -f "$HOME/.byobu/.windows-swap" "$HOME/.byobu/windows"' - printf "%s\n%s\n" "$WINDOWS\n" "$cleanup" > "$HOME/.byobu/windows" -elif ! grep -qs "^[^#]" "$HOME/.$PKG/windows"; then - DEFAULT_WINDOW="-t shell motd+shell" +WINDOW_LIST="$HOME/.$PKG/windows" +if [ -r "$BYOBU_WINDOWS" ]; then + # Override default window list, based on BYOBU_WINDOWS environment variable + WINDOW_LIST="$HOME/.$PKG/windows" fi +# Launch motd+shell, unless the user has default windows set to launch +grep -qs "^[^#]" "$WINDOW_LIST" || DEFAULT_WINDOW="-t shell motd+shell" +export BYOBU_WINDOWS + # Check if our terminfo supports 256 colors [ -x /usr/bin/tput ] && [ $(/usr/bin/tput colors 2>/dev/null || echo 0) -eq 256 ] && SCREEN_TERM="-T screen-256color" diff --git a/usr/share/byobu/profiles/byoburc b/usr/share/byobu/profiles/byoburc index 09437bdc..8305a051 100644 --- a/usr/share/byobu/profiles/byoburc +++ b/usr/share/byobu/profiles/byoburc @@ -20,5 +20,5 @@ ############################################################################### source $HOME/.byobu/profile -source $HOME/.byobu/windows +source $BYOBU_WINDOWS source $HOME/.screenrc