From af180e08e204b7c965cacc4d8f766ac02b3e5a97 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 5 Aug 2014 22:52:00 +0200 Subject: [PATCH] * usr/bin/byobu.in, usr/share/man/man1/byobu.1: LP: #907363 - fix custom window support for byobu-tmux --- debian/changelog | 4 ++++ usr/bin/byobu.in | 10 +++++++++- usr/share/man/man1/byobu.1 | 16 +++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index e2bddc2f..5cbee228 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,10 @@ byobu (5.85) unreleased; urgency=medium * usr/bin/byobu-layout.in: - add a list-layouts command + [ Dustin Kirkland ] + * usr/bin/byobu.in, usr/share/man/man1/byobu.1: LP: #907363 + - fix custom window support for byobu-tmux + -- Dustin Kirkland Mon, 28 Jul 2014 09:12:13 +0100 byobu (5.84-0ubuntu1) utopic; urgency=medium diff --git a/usr/bin/byobu.in b/usr/bin/byobu.in index 5a95f620..c8276a7f 100755 --- a/usr/bin/byobu.in +++ b/usr/bin/byobu.in @@ -115,6 +115,14 @@ case $BYOBU_BACKEND in BYOBU_PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc" DEFAULT_WINDOW="new-session -n $BYOBU_WINDOW_NAME ${BYOBU_PREFIX}/bin/byobu-shell" sessions=$($BYOBU_BACKEND list-sessions 2>/dev/null) || true + CUSTOM_WINDOW_SET=0 + if [ -s "$BYOBU_CONFIG_DIR/windows.tmux.$BYOBU_WINDOWS" ]; then + CUSTOM_WINDOW_SET=1 + BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows.tmux.$BYOBU_WINDOWS" + elif [ -s "$BYOBU_CONFIG_DIR/windows.tmux" ]; then + CUSTOM_WINDOW_SET=1 + BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows.tmux" + fi ;; screen) # Allow override of default window list, with BYOBU_WINDOWS environment variable @@ -168,7 +176,7 @@ if [ "$#" = "0" ]; then # Start new custom window set session case $BYOBU_BACKEND in tmux) - exec tmux $SCREEN_TERM $BYOBU_PROFILE + exec tmux $SCREEN_TERM $BYOBU_PROFILE $(cat "$BYOBU_WINDOWS") ;; screen) exec screen $SCREEN_TERM $BYOBU_SESSION_NAME $BYOBU_PROFILE diff --git a/usr/share/man/man1/byobu.1 b/usr/share/man/man1/byobu.1 index a7361eaa..1d58e434 100644 --- a/usr/share/man/man1/byobu.1 +++ b/usr/share/man/man1/byobu.1 @@ -119,11 +119,11 @@ Byobu name screen sessions "byobu", if unspecified. To hide sessions from \fBby .SH WINDOWS -Each open window in the screen session is displayed in the upper bar toward the far left. These are numbered, and include indicators as to activity in the window (see "activity" in \fBscreen\fP(1) for symbol definitions). The current active window is highlighted by inverting the background/text from the rest of the window bar. +Each open window in the screen session is displayed in the upper bar toward the far left. These are numbered, and include indicators as to activity in the window (see "activity" in \fBscreen\fP(1) and \fBtmux\fP(1) for symbol definitions). The current active window is highlighted by inverting the background/text from the rest of the window bar. -Users can create a list of windows to launch at startup in \fI$BYOBU_CONFIG_DIR/windows\fP. This file is the same syntax as \fI~/.screenrc\fP, each line specifying a window using the "screen" command, as described in \fBscreen\fP(1). +Users can create a list of windows to launch at startup in \fI$BYOBU_CONFIG_DIR/windows\fP and \fI$BYOBU_CONFIG_DIR/windows.tmux\fP. This file is the same syntax as \fI~/.screenrc\fP and \fI~/.tmuxrc\fP, each line specifying a window, as described in \fBscreen\fP(1) or \fBtmux\fP(1). -User can also launch Byobu with unique window sets. Users can store these as \fI$BYOBU_CONFIG_DIR/windows.[NAME]\fP, and launch Byobu with the environment variable \fBBYOBU_WINDOWS\fP. +User can also launch Byobu with unique window sets. Users can store these as \fI$BYOBU_CONFIG_DIR/windows.[NAME]\fP and \fI$BYOBU_CONFIG_DIR/windows.tmux.[NAME]\fP, and launch Byobu with the environment variable \fBBYOBU_WINDOWS\fP=NAME. For example: $ cat $BYOBU_CONFIG_DIR/windows.ssh_sessions @@ -133,6 +133,16 @@ For example: screen \-t collie ssh root@collie $ BYOBU_WINDOWS=ssh_sessions byobu +For example: + $ cat $BYOBU_CONFIG_DIR/windows.tmux.split4 + new-session 'bash' ; + split-window ; + split-window ; + split-window ; + select-layout tiled ; + select-pane -t 0 + $ BYOBU_WINDOWS=split4 byobu + .SH UNITS OF MEASURE byobu uses binary for capacity measurements of KB, MB, GB, and TB. This means multiples of 1024 rather than multiples of 1000, in accordance with JEDEC Standard 100B.01 for disk and memory capacity measurements. See: * http://en.wikipedia.org/wiki/JEDEC_memory_standards