From 4427f705318627be10a2b4b26c2a2a3fdc288df4 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 4 Feb 2010 17:25:17 -0800 Subject: [PATCH] debian/rules, usr/bin/byobu, usr/bin/byobu-launcher: deprecate the launcher script as a separate script; do this in /usr/bin/byobu --- debian/changelog | 3 ++- debian/rules | 1 + usr/bin/byobu | 14 +++++++++++++- usr/bin/byobu-launcher | 41 ----------------------------------------- 4 files changed, 16 insertions(+), 43 deletions(-) delete mode 100755 usr/bin/byobu-launcher diff --git a/debian/changelog b/debian/changelog index d23b3ed8..22ec7231 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ byobu (2.52) unreleased; urgency=low - * UNRELEASED + * debian/rules, usr/bin/byobu, usr/bin/byobu-launcher: deprecate the + launcher script as a separate script; do this in /usr/bin/byobu -- Dustin Kirkland Wed, 03 Feb 2010 10:56:23 -0800 diff --git a/debian/rules b/debian/rules index f82df523..db871531 100755 --- a/debian/rules +++ b/debian/rules @@ -54,6 +54,7 @@ install: build install-po #dh_link usr/bin/byobu-status usr/bin/screen-profiles-status #dh_link usr/bin/byobu-launcher usr/bin/screen-launcher dh_link usr/share/byobu/keybindings/f-keys usr/share/byobu/keybindings/common + dh_link usr/bin/byobu usr/bin/byobu-launcher for i in black dark dark_blue dark_cyan dark_green dark_purple dark_red dark_yellow light light_blue light_cyan light_green light_purple light_red light_yellow; do dh_link usr/share/byobu/profiles/common usr/share/byobu/profiles/$${i}; done dh_install -X.bzr diff --git a/usr/bin/byobu b/usr/bin/byobu index eea7810e..b0dfecdf 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -41,7 +41,19 @@ grep -qs "^[^#]" "$HOME/.$PKG/windows" && DEFAULT_WINDOW= || DEFAULT_WINDOW="mot # Now let's execute screen! if [ "$#" = "0" ]; then - exec screen $SCREEN_TERM -c "/usr/share/$PKG/profiles/byoburc" -t shell $DEFAULT_WINDOW + out=$(screen -wipe 2>/dev/null) || true + if echo "$out" | grep -qsi "^No Sockets found in "; then + # Start new session + exec screen $SCREEN_TERM -c "/usr/share/$PKG/profiles/byoburc" -t shell $DEFAULT_WINDOW + else + # Select and attach to an existing session + # Update ssh-agent socket + if [ -S "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then + rm -f "$RUN/$PKG.ssh-agent" + ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent" + fi + exec byobu-select-session + fi else exec screen $SCREEN_TERM -c "$HOME/.$PKG/profile" "$@" fi diff --git a/usr/bin/byobu-launcher b/usr/bin/byobu-launcher deleted file mode 100755 index 7c81b6d0..00000000 --- a/usr/bin/byobu-launcher +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -e -# -# byobu-launcher -# Copyright (C) 2008 Canonical Ltd. -# -# Authors: Nick Barcet -# 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 . - -PKG="byobu" -RUN="/var/run/screen/S-$USER" - -# Make sure that we're not already in a screen session -[ -z "$STY" ] || exit 0 -[ "$TERM" = "screen-bce" ] && exit 0 - -out=`screen -wipe 2>/dev/null` || true -if echo "$out" | grep -qsi "^No Sockets found in "; then - # Start new session - $(which $PKG >/dev/null) && exec $PKG || exec screen -else - # Set window title - printf "\033]0;${USER}@$(hostname) - ${PKG}\007" - # Update ssh-agent socket - if [ -S "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then - rm -f "$RUN/$PKG.ssh-agent" - ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent" - fi - exec byobu-select-session -fi