usr/bin/byobu, usr/share/byobu/profiles/byoburc: add support for

different window sets, LP: #517796
This commit is contained in:
Dustin Kirkland 2010-05-04 13:27:36 -05:00
commit 25c188ff0b
3 changed files with 18 additions and 28 deletions

5
debian/changelog vendored
View file

@ -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 * usr/lib/byobu/disk_io: fix regex to support RAID devices, LP: #572855
* debian/postinst: make debconf question failsafe, LP: #569041 * 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 * usr/bin/byobu-select-session: use screen -ls, less overhead
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 28 Apr 2010 23:11:14 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 28 Apr 2010 23:11:14 -0500

View file

@ -20,24 +20,12 @@
PKG="byobu" PKG="byobu"
VERSION=2.74 VERSION=2.74
while [ ! -z "$1" ]; do # Add a version argument for debugging purposes
case "$1" in if [ "$#" = "1" ] && [ "$1" = "-v" ]; then
-v|--version)
echo "$PKG version $VERSION" echo "$PKG version $VERSION"
screen -v screen -v
exit 0 exit 0
;; fi
--windows)
if [ -r "$2" ]; then
WINDOWS=$(cat "$2")
fi
shift 2
;;
*)
ARGS="$ARGS $1"
;;
esac
done
# Check if we're being autolaunched, and this user explicitly does not want it. # 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 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 # Set window title until https://bugs.launchpad.net/bugs/338722 is fixed in screen
printf "\033]0;${USER}@$(hostname) - ${PKG}\007" printf "\033]0;${USER}@$(hostname) - ${PKG}\007"
# Configure default windows
DEFAULT_WINDOW= DEFAULT_WINDOW=
if [ -n "$WINDOWS" ]; WINDOW_LIST="$HOME/.$PKG/windows"
mv -f "$HOME/.byobu/windows" "$HOME/.byobu/.windows-swap" if [ -r "$BYOBU_WINDOWS" ]; then
cleanup='mv -f "$HOME/.byobu/.windows-swap" "$HOME/.byobu/windows"' # Override default window list, based on BYOBU_WINDOWS environment variable
printf "%s\n%s\n" "$WINDOWS\n" "$cleanup" > "$HOME/.byobu/windows" WINDOW_LIST="$HOME/.$PKG/windows"
elif ! grep -qs "^[^#]" "$HOME/.$PKG/windows"; then
DEFAULT_WINDOW="-t shell motd+shell"
fi 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 # 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" [ -x /usr/bin/tput ] && [ $(/usr/bin/tput colors 2>/dev/null || echo 0) -eq 256 ] && SCREEN_TERM="-T screen-256color"

View file

@ -20,5 +20,5 @@
############################################################################### ###############################################################################
source $HOME/.byobu/profile source $HOME/.byobu/profile
source $HOME/.byobu/windows source $BYOBU_WINDOWS
source $HOME/.screenrc source $HOME/.screenrc