From a78e574ac6b263c89e58ecc0d54749b491816711 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 12 Feb 2012 09:49:16 -0600 Subject: [PATCH] * usr/lib/byobu/release, usr/share/byobu/status/statusrc, usr/share/man/man1/byobu.1: - based on suggestion from Scott Moser, support an abbreviated version of the release string - support a statusrc configuration variable of RELEASE_ABBREVIATED=N where N is the number of characters from the front of the release string to display --- debian/changelog | 7 +++++++ usr/lib/byobu/release | 6 +++++- usr/share/byobu/status/statusrc | 5 +++++ usr/share/man/man1/byobu.1 | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d1b83db2..37bbfd47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,13 @@ byobu (5.8) unreleased; urgency=low usr/lib/byobu/include/common, usr/lib/byobu/include/mondrian, usr/lib/byobu/include/shutil: - use printf where possible, saves some forks + * usr/lib/byobu/release, usr/share/byobu/status/statusrc, + usr/share/man/man1/byobu.1: + - based on suggestion from Scott Moser, support an abbreviated + version of the release string + - support a statusrc configuration variable of RELEASE_ABBREVIATED=N + where N is the number of characters from the front of the release + string to display -- Dustin Kirkland Mon, 30 Jan 2012 18:12:49 -0600 diff --git a/usr/lib/byobu/release b/usr/lib/byobu/release index 4a6412e5..1183ed11 100755 --- a/usr/lib/byobu/release +++ b/usr/lib/byobu/release @@ -61,7 +61,11 @@ __release() { ;; esac fi - color bold2; printf "%s" "$RELEASE"; color -- + if [ -n "$RELEASE_ABBREVIATED" ] && [ $RELEASE_ABBREVIATED -gt 0 ]; then + color bold2; printf "%.${RELEASE_ABBREVIATED}s" "$RELEASE"; color -- + else + color bold2; printf "%s" "$RELEASE"; color -- + fi } # vi: syntax=sh ts=4 noexpandtab diff --git a/usr/share/byobu/status/statusrc b/usr/share/byobu/status/statusrc index aaef12e2..a46ba33c 100644 --- a/usr/share/byobu/status/statusrc +++ b/usr/share/byobu/status/statusrc @@ -31,6 +31,11 @@ # via $DISTRO) #LOGO="\o/" +# Abbreviate the release to N characters +# By default, this is disabled. But if you set RELEASE_ABBREVIATED=1 +# and your lsb_release is "precise", only "p" will be displayed +#RELEASE_ABBREVIATED=1 + # Default: / #MONITORED_DISK=/ diff --git a/usr/share/man/man1/byobu.1 b/usr/share/man/man1/byobu.1 index 41ad472b..460a9690 100644 --- a/usr/share/man/man1/byobu.1 +++ b/usr/share/man/man1/byobu.1 @@ -83,7 +83,7 @@ Note that BYOBU_CONFIG_DIR=\fI$XDG_CONFIG_HOME/byobu\fP if defined, and \fI$HOME \fBreboot_required\fP \- symbol present if a reboot is required following a system update; displayed in the lower bar white text on a blue background by the symbol '(R)'; additionally, reboot_required will print '' in white text on a blue background, if Byobu requires you to reload your profile to affect some changes; it will also detect if your system is currently in \fBpowernap\fP(8) state and if so print '.zZ'. -\fBrelease\fP \- OS/distribution name of the release running on the current system as reported by \fBlsb_release(1)\fP or \fI/etc/issue\fP; displayed in the lower bar in bold black text toward the left on a grey background; you may override the detected release with RELEASE=Whatever in \fI$BYOBU_CONFIG_DIR/statusrc\fP +\fBrelease\fP \- OS/distribution name of the release running on the current system as reported by \fBlsb_release(1)\fP or \fI/etc/issue\fP; displayed in the lower bar in bold black text toward the left on a grey background; you may override the detected release with RELEASE=Whatever in \fI$BYOBU_CONFIG_DIR/statusrc\fP; you may also abbreviate the release string to N characters by setting RELEASE_ABBREVIATED=N in \fI$BYOBU_CONFIG_DIR/statusrc\fP \fBservices\fP \- users can configure a list of services to monitor, define the SERVICES variable in \fI$BYOBU_CONFIG_DIR/statusrc\fP, a whitespace separated of services, each service should include the init name of the service, then a pipe, and then an abbreviated name or symbol to display when running (e.g. SERVICES="ssh|ssh apache2|http"); displayed in the lower bar toward the center in cyan on a white background