mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* 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:
parent
dd45ab8889
commit
bb13ac774a
6 changed files with 75 additions and 39 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -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 <kirkland@ubuntu.com> Thu, 04 Aug 2011 17:57:12 -0500
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
profilesdir = $(datadir)/@PACKAGE@/profiles
|
||||
profiles_DATA = byoburc screenrc common tmux NONE
|
||||
profiles_DATA = byoburc screenrc common tmux tmuxrc NONE
|
||||
|
|
|
@ -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
|
||||
|
|
26
usr/share/byobu/profiles/tmuxrc
Normal file
26
usr/share/byobu/profiles/tmuxrc
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue