From 9ed6bc3e51cbd228a33c7adb06bc79b16e20c296 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 3 Aug 2013 15:29:36 -0500 Subject: [PATCH] * usr/bin/byobu-janitor: - enable users to remove the line from their ~/.bashrc --- debian/changelog | 2 ++ usr/bin/byobu-janitor | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2a68124c..695e8da1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ byobu (5.51) unreleased; urgency=low - fix a bash error * usr/bin/byobu-enable-prompt, usr/bin/byobu-janitor: - enable the new byobu colored prompt by default, on new logins + * usr/bin/byobu-janitor: + - enable users to remove the line from their ~/.bashrc -- Dustin Kirkland Fri, 02 Aug 2013 17:30:11 -0500 diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 7b190607..f865134d 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -72,7 +72,6 @@ MC=0 [ -r "$BYOBU_CONFIG_DIR/profile.tmux" ] || echo "source \$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.tmux" ] || touch "$BYOBU_CONFIG_DIR/keybindings.tmux" -[ -r "$BYOBU_CONFIG_DIR/prompt" ] || echo ". ${BYOBU_PREFIX}/share/${PKG}/profiles/bashrc #byobu-prompt#\n" > "$BYOBU_CONFIG_DIR/prompt" [ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows" [ -r "$BYOBU_CONFIG_DIR/backend" ] || echo "BYOBU_BACKEND=$BYOBU_BACKEND" > "$BYOBU_CONFIG_DIR/backend" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" @@ -114,4 +113,10 @@ killall -u $USER byobu-statusd >/dev/null 2>&1 || true # Clean up flag (new and old) rm -f "$FLAG" "/var/run/screen/S-$USER/$PKG.reload-required" +# Affects: Upgrades from <= byobu 5.50, install byobu prompt +if ! (grep -qs "#byobu-prompt#$" "$HOME/.bashrc") && ! [ -e "$BYOBU_CONFIG_DIR/prompt" ]; then + printf "[ -r $BYOBU_CONFIG_DIR/prompt ] && . $BYOBU_CONFIG_DIR/prompt #byobu-prompt#\n" >> "$HOME/.bashrc" +fi +[ -r "$BYOBU_CONFIG_DIR/prompt" ] || echo ". ${BYOBU_PREFIX}/share/${PKG}/profiles/bashrc #byobu-prompt#\n" > "$BYOBU_CONFIG_DIR/prompt" + # vi: syntax=sh ts=4 noexpandtab