From e395f4c673648faca290804909f6f84be8ab2212 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 6 Aug 2013 22:54:05 +0100 Subject: [PATCH] * usr/bin/byobu-prompt, usr/bin/Makefile.am, usr/share/man/man1/byobu- disable-prompt.1, usr/share/man/man1/byobu-enable-prompt.1, usr/share/man/man1/byobu-enable-prompt.1 => usr/share/man/man1/byobu-prompt.1, usr/share/man/man1/Makefile.am: - add some documentation and an interactive utility for toggling on and off the byobu-prompt, which is hinted in the inline bashrc comment --- debian/changelog | 7 +++++ usr/bin/Makefile.am | 2 +- usr/bin/byobu-prompt | 37 +++++++++++++++++++++++ usr/share/man/man1/Makefile.am | 2 +- usr/share/man/man1/byobu-disable-prompt.1 | 2 +- usr/share/man/man1/byobu-enable-prompt.1 | 33 +------------------- usr/share/man/man1/byobu-prompt.1 | 36 ++++++++++++++++++++++ 7 files changed, 84 insertions(+), 35 deletions(-) create mode 100755 usr/bin/byobu-prompt create mode 100644 usr/share/man/man1/byobu-prompt.1 diff --git a/debian/changelog b/debian/changelog index 2472b251..8efc979d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,13 @@ byobu (5.53) unreleased; urgency=low bashism hits * usr/share/byobu/profiles/bashrc: LP: #1208844 - revert override of term + * usr/bin/byobu-prompt, usr/bin/Makefile.am, usr/share/man/man1/byobu- + disable-prompt.1, usr/share/man/man1/byobu-enable-prompt.1, + usr/share/man/man1/byobu-enable-prompt.1 => + usr/share/man/man1/byobu-prompt.1, usr/share/man/man1/Makefile.am: + - add some documentation and an interactive utility for toggling + on and off the byobu-prompt, which is hinted in the inline + bashrc comment -- Dustin Kirkland Mon, 05 Aug 2013 09:23:03 +0100 diff --git a/usr/bin/Makefile.am b/usr/bin/Makefile.am index d00fae9b..98e3b0f4 100644 --- a/usr/bin/Makefile.am +++ b/usr/bin/Makefile.am @@ -1,4 +1,4 @@ -bin_SCRIPTS = byobu byobu-config byobu-ctrl-a byobu-disable byobu-disable-prompt byobu-enable byobu-enable-prompt byobu-export byobu-janitor byobu-keybindings byobu-launch byobu-launcher byobu-launcher-install byobu-launcher-uninstall byobu-layout byobu-quiet byobu-reconnect-sockets byobu-select-backend byobu-select-profile byobu-select-session byobu-silent byobu-status byobu-status-detail byobu-shell byobu-ugraph byobu-ulevel +bin_SCRIPTS = byobu byobu-config byobu-ctrl-a byobu-disable byobu-disable-prompt byobu-enable byobu-enable-prompt byobu-export byobu-janitor byobu-keybindings byobu-launch byobu-launcher byobu-launcher-install byobu-launcher-uninstall byobu-layout byobu-prompt byobu-quiet byobu-reconnect-sockets byobu-select-backend byobu-select-profile byobu-select-session byobu-silent byobu-status byobu-status-detail byobu-shell byobu-ugraph byobu-ulevel install-exec-hook: cd $(DESTDIR)$(bindir) && rm -f byobu-screen && $(LN_S) byobu byobu-screen diff --git a/usr/bin/byobu-prompt b/usr/bin/byobu-prompt new file mode 100755 index 00000000..3720be3f --- /dev/null +++ b/usr/bin/byobu-prompt @@ -0,0 +1,37 @@ +#!/bin/sh -e +# +# byobu-prompt +# Copyright (C) 2013 Dustin Kirkland +# +# Authors: 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" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/include/common" + +echo +echo -n "Do you want to enable Byobu's bash color prompt? [Y/n]: " +answer=$(head -n1) +echo +case "$answer" in + "n"|"N") + exec byobu-disable-prompt + ;; + *) + exec byobu-enable-prompt +esac + +# vi: syntax=sh ts=4 noexpandtab diff --git a/usr/share/man/man1/Makefile.am b/usr/share/man/man1/Makefile.am index a24ab81a..e63f4746 100644 --- a/usr/share/man/man1/Makefile.am +++ b/usr/share/man/man1/Makefile.am @@ -1 +1 @@ -man_MANS = byobu.1 byobu-config.1 byobu-ctrl-a.1 byobu-disable.1 byobu-disable-prompt.1 byobu-enable.1 byobu-enable-prompt.1 byobu-export.1 byobu-janitor.1 byobu-keybindings.1 byobu-launch.1 byobu-launcher.1 byobu-launcher-install.1 byobu-launcher-uninstall.1 byobu-layout.1 byobu-quiet.1 byobu-reconnect-sockets.1 byobu-screen.1 byobu-select-backend.1 byobu-select-profile.1 byobu-select-session.1 byobu-shell.1 byobu-silent.1 byobu-status.1 byobu-status-detail.1 byobu-tmux.1 +man_MANS = byobu.1 byobu-config.1 byobu-ctrl-a.1 byobu-disable.1 byobu-disable-prompt.1 byobu-enable.1 byobu-enable-prompt.1 byobu-export.1 byobu-janitor.1 byobu-keybindings.1 byobu-launch.1 byobu-launcher.1 byobu-launcher-install.1 byobu-launcher-uninstall.1 byobu-layout.1 byobu-prompt.1 byobu-quiet.1 byobu-reconnect-sockets.1 byobu-screen.1 byobu-select-backend.1 byobu-select-profile.1 byobu-select-session.1 byobu-shell.1 byobu-silent.1 byobu-status.1 byobu-status-detail.1 byobu-tmux.1 diff --git a/usr/share/man/man1/byobu-disable-prompt.1 b/usr/share/man/man1/byobu-disable-prompt.1 index 4d8b244b..e5283d1c 100644 --- a/usr/share/man/man1/byobu-disable-prompt.1 +++ b/usr/share/man/man1/byobu-disable-prompt.1 @@ -1 +1 @@ -.so man1/byobu-enable-prompt.1 +.so man1/byobu-prompt.1 diff --git a/usr/share/man/man1/byobu-enable-prompt.1 b/usr/share/man/man1/byobu-enable-prompt.1 index 2c5f2fb8..e5283d1c 100644 --- a/usr/share/man/man1/byobu-enable-prompt.1 +++ b/usr/share/man/man1/byobu-enable-prompt.1 @@ -1,32 +1 @@ -.TH byobu-enable-prompt 1 "26 July 2013" byobu "byobu" -.SH NAME -byobu-enable-prompt, byobu-disable-prompt \- add and remove a nice color prompt to your shell configuration - -.SH SYNOPSIS -\fBbyobu-enable-prompt\fP -.TP -\fBbyobu-disable-prompt\fP - -.SH DESCRIPTION -\fBbyobu-enable-prompt\fP will add one line to your \fI~/.bashrc\fP. - -You can safely remove the line from your \fI~/.bashrc\fP, which ends in \fB#byobu-prompt\fP. - -\fBbyobu-disable-prompt\fP will remove its color configuration from \fI~/.bashrc\fP. - -.SH "BUGS" - -This is currently only compatible with \fBbash(1)\fP. - -.SH SEE ALSO -.PD 0 -.TP -\fBbash\fP(1) -.TP -\fBhttp://byobu.co\fP -.PD - -.SH AUTHOR -This manpage and the utility were written by Dustin Kirkland for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation. - -The complete text of the GNU General Public License can be found in \fI/usr/share/common-licenses/GPL\fP on Debian/Ubuntu systems, or in \fI/usr/share/doc/fedora-release-*/GPL\fP on Fedora systems, or on the web at \fIhttp://www.gnu.org/licenses/gpl.txt\fP. +.so man1/byobu-prompt.1 diff --git a/usr/share/man/man1/byobu-prompt.1 b/usr/share/man/man1/byobu-prompt.1 new file mode 100644 index 00000000..dfe40364 --- /dev/null +++ b/usr/share/man/man1/byobu-prompt.1 @@ -0,0 +1,36 @@ +.TH byobu-prompt 1 "26 July 2013" byobu "byobu" +.SH NAME +byobu-prompt, byobu-enable-prompt, byobu-disable-prompt \- add and remove a nice color prompt to your shell configuration + +.SH SYNOPSIS +\fBbyobu-prompt\fP +.TP +\fBbyobu-enable-prompt\fP +.TP +\fBbyobu-disable-prompt\fP + +.SH DESCRIPTION +\fBbyobu-enable-prompt\fP will add one line to your \fI~/.bashrc\fP. + +You can safely remove the line from your \fI~/.bashrc\fP, which ends in \fB#byobu-prompt\fP. + +\fBbyobu-disable-prompt\fP will remove its color configuration from \fI~/.bashrc\fP. + +\fBbyobu-prompt\fP is an interactive wrapper of the previous two tools. + +.SH "BUGS" + +This is currently only compatible with \fBbash(1)\fP. + +.SH SEE ALSO +.PD 0 +.TP +\fBbash\fP(1) +.TP +\fBhttp://byobu.co\fP +.PD + +.SH AUTHOR +This manpage and the utility were written by Dustin Kirkland for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation. + +The complete text of the GNU General Public License can be found in \fI/usr/share/common-licenses/GPL\fP on Debian/Ubuntu systems, or in \fI/usr/share/doc/fedora-release-*/GPL\fP on Fedora systems, or on the web at \fIhttp://www.gnu.org/licenses/gpl.txt\fP.