diff --git a/debian/changelog b/debian/changelog index 22f03686..c3e4749b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ byobu (4.26) unreleased; urgency=low * usr/bin/byobu: - test that there is something in the windows files + * usr/bin/byobu, usr/bin/byobu-janitor, + usr/share/byobu/profiles/Makefile.am, usr/share/byobu/profiles/tmux, + usr/share/byobu/profiles/tmuxrc: + - initial support for launching tmux -- Dustin Kirkland Thu, 04 Aug 2011 17:57:12 -0500 diff --git a/usr/bin/byobu b/usr/bin/byobu index c48ab304..944ddf77 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -45,47 +45,52 @@ byobu-janitor --force # Set the window title [ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@${HOSTNAME:-$(hostname)} - ${PKG}\007" -# Allow override of default window list, with BYOBU_WINDOWS environment variable -CUSTOM_WINDOW_SET=0 -if [ -s "$BYOBU_WINDOWS" ]; then - CUSTOM_WINDOW_SET=1 -elif [ -s "$BYOBU_CONFIG_DIR/windows.$BYOBU_WINDOWS" ]; then - CUSTOM_WINDOW_SET=1 - BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows.$BYOBU_WINDOWS" -elif [ "$#" = "0" ]; then - BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows" -else - BYOBU_WINDOWS="/dev/null" -fi -export BYOBU_WINDOWS - -# Launch shell, unless the user has default windows set to launch -uncommented_lines < "$BYOBU_WINDOWS" && DEFAULT_WINDOW= || DEFAULT_WINDOW="-t ${SHELL##*/} byobu-shell" - -# Check if our terminfo supports 256 colors -if command -v tput >/dev/null; then - if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then - SCREEN_TERM="-T screen-256color" - fi -fi - # Drop a symlink to the ssh socket in $HOME, since we can ensure that exists if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then ln -sf "$SSH_AUTH_SOCK" "$BYOBU_CONFIG_DIR/.ssh-agent" fi -# Some users want to maintain separate configurations -# if they use both GNU Screen and byobu on the same system -if [ -r "$HOME/.byoburc" ]; then - PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/byoburc" -else - PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/screenrc" -fi -NAME="-S $PKG" -# Zero out $NAME if user has specified a session name -for i in "$@"; do - case $i in -*r*|-*d*|-*D*|-*S*|-ls|-list) NAME= ;; esac -done +case $BYOBU_BACKEND in + tmux) + PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc" + ;; + *) + # Allow override of default window list, with BYOBU_WINDOWS environment variable + CUSTOM_WINDOW_SET=0 + if [ -s "$BYOBU_WINDOWS" ]; then + CUSTOM_WINDOW_SET=1 + elif [ -s "$BYOBU_CONFIG_DIR/windows.$BYOBU_WINDOWS" ]; then + CUSTOM_WINDOW_SET=1 + BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows.$BYOBU_WINDOWS" + elif [ "$#" = "0" ]; then + BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows" + else + BYOBU_WINDOWS="/dev/null" + fi + export BYOBU_WINDOWS + # Launch shell, unless the user has default windows set to launch + uncommented_lines < "$BYOBU_WINDOWS" && DEFAULT_WINDOW= || DEFAULT_WINDOW="-t ${SHELL##*/} byobu-shell" + # Check if our terminfo supports 256 colors + if command -v tput >/dev/null; then + if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then + SCREEN_TERM="-T screen-256color" + fi + fi + # Some users want to maintain separate configurations + # if they use both GNU Screen and byobu on the same system + if [ -r "$HOME/.byoburc" ]; then + PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/byoburc" + else + PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/screenrc" + fi + NAME="-S $PKG" + # Zero out $NAME if user has specified a session name + for i in "$@"; do + case $i in -*r*|-*d*|-*D*|-*S*|-ls|-list) NAME= ;; esac + done + ;; +esac + # Now let's execute the backend! if [ "$#" = "0" ]; then out=$($BYOBU_BACKEND -wipe 2>/dev/null) || true diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 347046db..e7d11d95 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -49,6 +49,7 @@ fi # Setup initial local user configuration [ -r "$BYOBU_CONFIG_DIR/color" ] || printf "BACKGROUND=k\nFOREGROUND=w\nMONOCHROME=0" > "$BYOBU_CONFIG_DIR/color" [ -r "$BYOBU_CONFIG_DIR/profile" ] || echo "source $BYOBU_PREFIX/share/$PKG/profiles/common" > "$BYOBU_CONFIG_DIR/profile" +[ -r "$BYOBU_CONFIG_DIR/profile.tmux" ] || echo "source-file $BYOBU_PREFIX/share/$PKG/profiles/tmux" > "$BYOBU_CONFIG_DIR/profile.tmux" [ -r "$BYOBU_CONFIG_DIR/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$BYOBU_CONFIG_DIR/keybindings" [ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows" [ -r "$BYOBU_CONFIG_DIR/status" ] || touch "$BYOBU_CONFIG_DIR/status" diff --git a/usr/share/byobu/profiles/Makefile.am b/usr/share/byobu/profiles/Makefile.am index dc27453c..31ba0ddf 100644 --- a/usr/share/byobu/profiles/Makefile.am +++ b/usr/share/byobu/profiles/Makefile.am @@ -1,2 +1,2 @@ profilesdir = $(datadir)/@PACKAGE@/profiles -profiles_DATA = byoburc screenrc common tmux NONE +profiles_DATA = byoburc screenrc common tmux tmuxrc NONE diff --git a/usr/share/byobu/profiles/tmux b/usr/share/byobu/profiles/tmux index ff28939b..e4a3f2e2 100644 --- a/usr/share/byobu/profiles/tmux +++ b/usr/share/byobu/profiles/tmux @@ -65,7 +65,7 @@ set -g status-fg white set -g status-interval 1 set -g status-left-length 256 set -g status-right-length 256 -set -g status-left '#(byobu-status logo)#(byobu-status release)[' -set -g status-right ']%Y-%m-%d %H:%M:%S' +set -g status-left '#(byobu-status logo)' +set -g status-right '%Y-%m-%d %H:%M:%S' set -g message-bg magenta set -g message-fg white diff --git a/usr/share/byobu/profiles/tmuxrc b/usr/share/byobu/profiles/tmuxrc new file mode 100644 index 00000000..2cd6f722 --- /dev/null +++ b/usr/share/byobu/profiles/tmuxrc @@ -0,0 +1,26 @@ +############################################################################### +# Load: +# * the stock byobu profile +# * any windows +# * and the local byoburc (instead of .screenrc) +# Used at startup but not profile refresh +# +# Copyright (C) 2009-2011 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +############################################################################### + +source-file $BYOBU_CONFIG_DIR/profile.tmux +source-file $HOME/.byoburc.tmux