* etc/byobu/backend, usr/bin/byobu, usr/lib/byobu/.common,

usr/lib/byobu/.dirs, usr/share/byobu/status/status,
  usr/share/man/man1/byobu.1: LP: #836090
  - fix handling of byobu backend (screen|tmux) handling; thanks to
    lp:~zorun-42 for the fix
This commit is contained in:
Dustin Kirkland 2011-09-08 11:44:38 -07:00
commit 41d25abd31
7 changed files with 32 additions and 11 deletions

5
debian/changelog vendored
View file

@ -14,6 +14,11 @@ byobu (4.33) unreleased; urgency=low
* usr/lib/byobu/apport: LP: #842113
- fix broken detection of apport bug reports, thanks to lp:~masterpatricko
for the suggested fix
* etc/byobu/backend, usr/bin/byobu, usr/lib/byobu/.common,
usr/lib/byobu/.dirs, usr/share/byobu/status/status,
usr/share/man/man1/byobu.1: LP: #836090
- fix handling of byobu backend (screen|tmux) handling; thanks to
lp:~zorun-42 for the fix
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 26 Aug 2011 19:07:32 -0500

View file

@ -1,2 +1,4 @@
# BYOBU_BACKEND can currently be "screen" or "tmux"
# Override this on a per-user basis by editing "$BYOBU_CONFIG_DIR/backend"
# or by launching either "byobu-screen" or "byobu-tmux" instead of "byobu".
BYOBU_BACKEND="screen"

View file

@ -31,9 +31,18 @@ if [ ! -O "$HOME" ]; then
exit 1
fi
# Determine backend as early as possible, if applicable
case "$0" in
*byobu-screen) BYOBU_BACKEND="screen" ;;
*byobu-tmux) BYOBU_BACKEND="tmux" ;;
esac
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
# At this point, we're sure BYOBU_BACKEND is properly defined
export BYOBU_BACKEND
# Add a version argument for debugging purposes
if [ "$#" = "1" ]; then
case "$1" in
@ -50,12 +59,6 @@ if [ "$0" = "/etc/profile.d/Z98-$PKG.sh" ] && [ -r "$BYOBU_CONFIG_DIR/disable-au
exit 0
fi
# Determine backend
case "$0" in
*byobu-screen) export BYOBU_BACKEND="screen" ;;
*byobu-tmux) export BYOBU_BACKEND="tmux" ;;
esac
# Sanitize the environment
byobu-janitor --force

View file

@ -19,7 +19,20 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ -z "${BYOBU_INCLUDED_LIBS}" ]; then
# Needed to set up $BYOBU_CONFIG_DIR
. "${BYOBU_PREFIX}/lib/${PKG}/.dirs"
# If the backend is already set (eg. running `byobu-tmux`), do nothing.
if [ -z "${BYOBU_BACKEND}" ]; then
[ -r "/etc/$PKG/backend" ] && . "/etc/$PKG/backend"
[ -r "$BYOBU_CONFIG_DIR/backend" ] && . "$BYOBU_CONFIG_DIR/backend"
# Just in case there's no config file at all
[ -z "${BYOBU_BACKEND}" ] && BYOBU_BACKEND=screen
fi
# Creating backend cache
[ -d "$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND" ] || mkdir -p "$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND"
. "${BYOBU_PREFIX}/lib/${PKG}/.shutil"
. "${BYOBU_PREFIX}/lib/${PKG}/.constants"
BYOBU_INCLUDED_LIBS=1

View file

@ -52,7 +52,3 @@ else
# But if not, we'll use a cache directory
export BYOBU_RUN_DIR="$HOME/.cache/$PKG"
fi
# Backend cache
[ -n "$BYOBU_BACKEND" ] || BYOBU_BACKEND="screen"
[ -d "$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND" ] || mkdir -p "$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND"

View file

@ -20,6 +20,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Status beginning with '#' are disabled.
# Screen has two status lines, with 4 quadrants for status
screen_upper_left="color"
screen_upper_right="color whoami hostname ip_address menu"

View file

@ -10,7 +10,7 @@ Options to \fBbyobu\fP are simply passed through \fBscreen\fP(1).
.SH DESCRIPTION
\fBbyobu\fP is a script that launches GNU screen in the byobu configuration. This enables the display of system information and status notifications within two lines at the bottom of the screen session. It also enables multiple tabbed terminal sessions, accessible through simple keystrokes.
Note that BYOBU_CONFIG_DIR=\fI$HOME/.byobu\fP.
Note that BYOBU_CONFIG_DIR=\fI$XDG_CONFIG_HOME/byobu\fP if defined, and \fI$HOME/.byobu\fP otherwise.
.SH STATUS NOTIFICATIONS