From 9d1f4af4928adbbf807160a4d47d58a3781e98fe Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 8 Dec 2011 10:59:43 -0600 Subject: [PATCH] * usr/bin/byobu, usr/bin/byobu-ctrl-a, usr/bin/byobu-disable, usr/bin/byobu-enable, usr/bin/byobu-export, usr/bin/byobu-janitor, usr/bin/byobu-launch, usr/bin/byobu-launcher, usr/bin/byobu- launcher-install, usr/bin/byobu-launcher-uninstall, usr/bin/byobu- quiet, usr/bin/byobu-reconnect-sockets, usr/bin/byobu-select- backend, usr/bin/byobu-select-profile, usr/bin/byobu-shell, usr/bin/byobu-silent, usr/bin/byobu-status, usr/bin/byobu-status- detail, usr/bin/byobu-ugraph, usr/bin/byobu-ulevel, usr/lib/byobu/include/dirs, usr/share/byobu/profiles/byoburc: - big changeset to solve two annoying bugs, LP: #897473, #861291 - take over ~/.byoburc, and use it for storing global byobu shell configuration, namely BYOBU_PREFIX when necessary + note that some users might have previously used ~/.byoburc to store byobu-only screen configuration + these users should now use ~/.byobu/.screenrc instead (also because byobu now supports both screen and tmux) - on first run, if byobu is running outside of its normal location in /usr/bin/byobu, it will automatically detect and append the correct BYOBU_PREFIX value and store it in ~/.byoburc - ~/.byoburc is now read by all usr/bin/* in order to find the correct prefix --- README | 3 +-- debian/changelog | 21 +++++++++++++++++++++ usr/bin/byobu | 18 ++++++++++++++++-- usr/bin/byobu-ctrl-a | 1 + usr/bin/byobu-disable | 1 + usr/bin/byobu-enable | 1 + usr/bin/byobu-export | 1 + usr/bin/byobu-janitor | 1 + usr/bin/byobu-launch | 1 + usr/bin/byobu-launcher | 1 + usr/bin/byobu-launcher-install | 1 + usr/bin/byobu-launcher-uninstall | 1 + usr/bin/byobu-quiet | 1 + usr/bin/byobu-reconnect-sockets | 1 + usr/bin/byobu-select-backend | 1 + usr/bin/byobu-select-profile | 1 + usr/bin/byobu-shell | 1 + usr/bin/byobu-silent | 1 + usr/bin/byobu-status | 1 + usr/bin/byobu-status-detail | 1 + usr/bin/byobu-ugraph | 1 + usr/bin/byobu-ulevel | 1 + usr/lib/byobu/include/dirs | 1 + usr/share/byobu/profiles/byoburc | 2 +- 24 files changed, 59 insertions(+), 5 deletions(-) diff --git a/README b/README index 3843d782..6245e2bb 100644 --- a/README +++ b/README @@ -20,8 +20,7 @@ install locally, using the following instructions... 5) Install: make install 6) Update your PATH and BYOBU_PREFIX environment variables - echo "export BYOBU_PREFIX=$HOME/byobu" >> $HOME/.bashrc - echo "export PATH=$BYOBU_PREFIX/bin:$PATH" >> $HOME/.bashrc + echo "export PATH=$HOME/byobu/bin:$PATH" >> $HOME/.bashrc . $HOME/.bashrc 7) Run: byobu diff --git a/debian/changelog b/debian/changelog index 43b0f473..416f3a7e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,27 @@ byobu (4.53) unreleased; urgency=low * usr/share/byobu/profiles/common: LP: #900812 - start screen with at least a 1 second message wait + * usr/bin/byobu, usr/bin/byobu-ctrl-a, usr/bin/byobu-disable, + usr/bin/byobu-enable, usr/bin/byobu-export, usr/bin/byobu-janitor, + usr/bin/byobu-launch, usr/bin/byobu-launcher, usr/bin/byobu- + launcher-install, usr/bin/byobu-launcher-uninstall, usr/bin/byobu- + quiet, usr/bin/byobu-reconnect-sockets, usr/bin/byobu-select- + backend, usr/bin/byobu-select-profile, usr/bin/byobu-shell, + usr/bin/byobu-silent, usr/bin/byobu-status, usr/bin/byobu-status- + detail, usr/bin/byobu-ugraph, usr/bin/byobu-ulevel, + usr/lib/byobu/include/dirs, usr/share/byobu/profiles/byoburc: + - big changeset to solve two annoying bugs, LP: #897473, #861291 + - take over ~/.byoburc, and use it for storing global byobu shell + configuration, namely BYOBU_PREFIX when necessary + + note that some users might have previously used ~/.byoburc to + store byobu-only screen configuration + + these users should now use ~/.byobu/.screenrc instead (also + because byobu now supports both screen and tmux) + - on first run, if byobu is running outside of its normal location + in /usr/bin/byobu, it will automatically detect and append the + correct BYOBU_PREFIX value and store it in ~/.byoburc + - ~/.byoburc is now read by all usr/bin/* in order to find the + correct prefix -- Dustin Kirkland Mon, 05 Dec 2011 08:59:08 -0600 diff --git a/usr/bin/byobu b/usr/bin/byobu index 9fdad79e..2543b33f 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -37,6 +37,20 @@ case "$0" in *byobu-tmux) BYOBU_BACKEND="tmux" ;; esac +# Source local byobu config +if [ -r "$HOME/.byoburc" ]; then + # Ensure that this configuration is usable + . "$HOME/.byoburc" || mv -f "$HOME/.byoburc".orig +fi +if [ -z "${BYOBU_PREFIX}" ]; then + # Find and export the installation location prefix + prefix="$(dirname $(dirname $(readlink -f $0)))" + if [ "$prefix" != "/usr" ]; then + echo "export BYOBU_PREFIX='$prefix'" >> "$HOME/.byoburc" + . "$HOME/.byoburc" + fi +fi +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" @@ -81,7 +95,7 @@ case $BYOBU_BACKEND in # Use 256 colors, unless the user has overridden [ -z "$SCREEN_TERM" ] && SCREEN_TERM="-2" PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc" - sessions=$($BYOBU_BACKEND list-sessions) || true + sessions=$($BYOBU_BACKEND list-sessions 2>/dev/null) || true ;; *) # Allow override of default window list, with BYOBU_WINDOWS environment variable @@ -107,7 +121,7 @@ case $BYOBU_BACKEND in 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 + if [ -r "$BYOBU_CONFIG_DIR/.screenrc" ]; then PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/byoburc" else PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/screenrc" diff --git a/usr/bin/byobu-ctrl-a b/usr/bin/byobu-ctrl-a index 8be1fc5a..1cec73ce 100755 --- a/usr/bin/byobu-ctrl-a +++ b/usr/bin/byobu-ctrl-a @@ -26,6 +26,7 @@ EOF } PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-disable b/usr/bin/byobu-disable index f00dfade..56566618 100755 --- a/usr/bin/byobu-disable +++ b/usr/bin/byobu-disable @@ -18,6 +18,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-enable b/usr/bin/byobu-enable index 494f7dff..3ca132cd 100755 --- a/usr/bin/byobu-enable +++ b/usr/bin/byobu-enable @@ -18,6 +18,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-export b/usr/bin/byobu-export index 5efee614..0246e284 100755 --- a/usr/bin/byobu-export +++ b/usr/bin/byobu-export @@ -18,6 +18,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 5cbc8bbe..c031a403 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -20,6 +20,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-launch b/usr/bin/byobu-launch index 569a7fd6..3bc273eb 100755 --- a/usr/bin/byobu-launch +++ b/usr/bin/byobu-launch @@ -42,6 +42,7 @@ elif [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_ unset _tty BYOBU_SOURCED_PROFILE=1 PKG="byobu" + [ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" # Ensure that autolaunch is not explicitly disabled diff --git a/usr/bin/byobu-launcher b/usr/bin/byobu-launcher index 52df8baa..0eeec21e 100755 --- a/usr/bin/byobu-launcher +++ b/usr/bin/byobu-launcher @@ -21,6 +21,7 @@ PKG="byobu" # Bad things happen if you run byobu, but you don't own your $HOME # ie, rather than "sudo byobu", you must run "sudo -H byobu" if [ -O "$HOME" ]; then + [ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" if [ -e "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then diff --git a/usr/bin/byobu-launcher-install b/usr/bin/byobu-launcher-install index a129fe58..dd5d2cb6 100755 --- a/usr/bin/byobu-launcher-install +++ b/usr/bin/byobu-launcher-install @@ -19,6 +19,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-launcher-uninstall b/usr/bin/byobu-launcher-uninstall index 24be96f6..f2a5ab9c 100755 --- a/usr/bin/byobu-launcher-uninstall +++ b/usr/bin/byobu-launcher-uninstall @@ -19,6 +19,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-quiet b/usr/bin/byobu-quiet index d3e8c170..bdbfefad 100755 --- a/usr/bin/byobu-quiet +++ b/usr/bin/byobu-quiet @@ -18,6 +18,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-reconnect-sockets b/usr/bin/byobu-reconnect-sockets index 8abf2aa7..f25d42cb 100755 --- a/usr/bin/byobu-reconnect-sockets +++ b/usr/bin/byobu-reconnect-sockets @@ -22,6 +22,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-select-backend b/usr/bin/byobu-select-backend index 3b9274fa..2561397a 100755 --- a/usr/bin/byobu-select-backend +++ b/usr/bin/byobu-select-backend @@ -19,6 +19,7 @@ PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile index 45dd2229..5a5df547 100755 --- a/usr/bin/byobu-select-profile +++ b/usr/bin/byobu-select-profile @@ -23,6 +23,7 @@ # ./debian/rules get-po PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-shell b/usr/bin/byobu-shell index a3e5bae0..6568335c 100755 --- a/usr/bin/byobu-shell +++ b/usr/bin/byobu-shell @@ -18,6 +18,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-silent b/usr/bin/byobu-silent index fadbe355..8d0b4aa4 100755 --- a/usr/bin/byobu-silent +++ b/usr/bin/byobu-silent @@ -18,6 +18,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index f4f3fc89..99e57cd3 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -19,6 +19,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-status-detail b/usr/bin/byobu-status-detail index 87eef511..e1f67035 100755 --- a/usr/bin/byobu-status-detail +++ b/usr/bin/byobu-status-detail @@ -18,6 +18,7 @@ # along with this program. If not, see . PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-ugraph b/usr/bin/byobu-ugraph index 13dab3ab..94217a94 100755 --- a/usr/bin/byobu-ugraph +++ b/usr/bin/byobu-ugraph @@ -25,6 +25,7 @@ #--------------------------------------------------------------------- PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/bin/byobu-ulevel b/usr/bin/byobu-ulevel index 8a6e7709..877de325 100755 --- a/usr/bin/byobu-ulevel +++ b/usr/bin/byobu-ulevel @@ -36,6 +36,7 @@ # command-line option. PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" diff --git a/usr/lib/byobu/include/dirs b/usr/lib/byobu/include/dirs index 37879a44..e9a499cd 100755 --- a/usr/lib/byobu/include/dirs +++ b/usr/lib/byobu/include/dirs @@ -21,6 +21,7 @@ PKG="byobu" # Some users build and install byobu themselves, rather than from a distro +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" [ -n "$BYOBU_PREFIX" ] || BYOBU_PREFIX="/usr" # Create and export the user configuration directory diff --git a/usr/share/byobu/profiles/byoburc b/usr/share/byobu/profiles/byoburc index 2d37065d..e7f826a4 100644 --- a/usr/share/byobu/profiles/byoburc +++ b/usr/share/byobu/profiles/byoburc @@ -24,4 +24,4 @@ source $BYOBU_CONFIG_DIR/profile source $BYOBU_WINDOWS -source $HOME/.byoburc +source $BYOBU_CONFIG_DIR/.screenrc