* 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
This commit is contained in:
Dustin Kirkland 2011-08-10 16:26:52 -05:00
commit bb13ac774a
6 changed files with 75 additions and 39 deletions

4
debian/changelog vendored
View file

@ -2,6 +2,10 @@ byobu (4.26) unreleased; urgency=low
* usr/bin/byobu: * usr/bin/byobu:
- test that there is something in the windows files - 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 <kirkland@ubuntu.com> Thu, 04 Aug 2011 17:57:12 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Thu, 04 Aug 2011 17:57:12 -0500

View file

@ -45,6 +45,16 @@ byobu-janitor --force
# Set the window title # Set the window title
[ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@${HOSTNAME:-$(hostname)} - ${PKG}\007" [ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@${HOSTNAME:-$(hostname)} - ${PKG}\007"
# 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
case $BYOBU_BACKEND in
tmux)
PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc"
;;
*)
# Allow override of default window list, with BYOBU_WINDOWS environment variable # Allow override of default window list, with BYOBU_WINDOWS environment variable
CUSTOM_WINDOW_SET=0 CUSTOM_WINDOW_SET=0
if [ -s "$BYOBU_WINDOWS" ]; then if [ -s "$BYOBU_WINDOWS" ]; then
@ -58,22 +68,14 @@ else
BYOBU_WINDOWS="/dev/null" BYOBU_WINDOWS="/dev/null"
fi fi
export BYOBU_WINDOWS export BYOBU_WINDOWS
# Launch shell, unless the user has default windows set to launch # Launch shell, unless the user has default windows set to launch
uncommented_lines < "$BYOBU_WINDOWS" && DEFAULT_WINDOW= || DEFAULT_WINDOW="-t ${SHELL##*/} byobu-shell" uncommented_lines < "$BYOBU_WINDOWS" && DEFAULT_WINDOW= || DEFAULT_WINDOW="-t ${SHELL##*/} byobu-shell"
# Check if our terminfo supports 256 colors # Check if our terminfo supports 256 colors
if command -v tput >/dev/null; then if command -v tput >/dev/null; then
if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then
SCREEN_TERM="-T screen-256color" SCREEN_TERM="-T screen-256color"
fi fi
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 # Some users want to maintain separate configurations
# if they use both GNU Screen and byobu on the same system # if they use both GNU Screen and byobu on the same system
if [ -r "$HOME/.byoburc" ]; then if [ -r "$HOME/.byoburc" ]; then
@ -86,6 +88,9 @@ NAME="-S $PKG"
for i in "$@"; do for i in "$@"; do
case $i in -*r*|-*d*|-*D*|-*S*|-ls|-list) NAME= ;; esac case $i in -*r*|-*d*|-*D*|-*S*|-ls|-list) NAME= ;; esac
done done
;;
esac
# Now let's execute the backend! # Now let's execute the backend!
if [ "$#" = "0" ]; then if [ "$#" = "0" ]; then
out=$($BYOBU_BACKEND -wipe 2>/dev/null) || true out=$($BYOBU_BACKEND -wipe 2>/dev/null) || true

View file

@ -49,6 +49,7 @@ fi
# Setup initial local user configuration # 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/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" ] || 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/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/windows" ] || touch "$BYOBU_CONFIG_DIR/windows"
[ -r "$BYOBU_CONFIG_DIR/status" ] || touch "$BYOBU_CONFIG_DIR/status" [ -r "$BYOBU_CONFIG_DIR/status" ] || touch "$BYOBU_CONFIG_DIR/status"

View file

@ -1,2 +1,2 @@
profilesdir = $(datadir)/@PACKAGE@/profiles profilesdir = $(datadir)/@PACKAGE@/profiles
profiles_DATA = byoburc screenrc common tmux NONE profiles_DATA = byoburc screenrc common tmux tmuxrc NONE

View file

@ -65,7 +65,7 @@ set -g status-fg white
set -g status-interval 1 set -g status-interval 1
set -g status-left-length 256 set -g status-left-length 256
set -g status-right-length 256 set -g status-right-length 256
set -g status-left '#(byobu-status logo)#(byobu-status release)[' set -g status-left '#(byobu-status logo)'
set -g status-right ']%Y-%m-%d %H:%M:%S' set -g status-right '%Y-%m-%d %H:%M:%S'
set -g message-bg magenta set -g message-bg magenta
set -g message-fg white set -g message-fg white

View file

@ -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 <kirkland@ubuntu.com>
#
# 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 <http://www.gnu.org/licenses/>.
###############################################################################
source-file $BYOBU_CONFIG_DIR/profile.tmux
source-file $HOME/.byoburc.tmux