From 585d1559cdc8c3e1bae3ee2d6be216157aa2b64d Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 13 Dec 2009 19:06:07 -0800 Subject: [PATCH] byobu-status: allow for no color decorations, helps with older versions of screen, LP: #432165 --- byobu-status | 8 +++++--- debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/byobu-status b/byobu-status index de9f6b88..65860924 100755 --- a/byobu-status +++ b/byobu-status @@ -33,8 +33,10 @@ find_script () { # Define colors ESC="\005" color() { + if [ -z "$1" ] || [ "$COLOR" = "none" ]; then + return 0 + fi case $1 in - "") true ;; -) printf "$ESC{-}" ;; esc) printf "$ESC" ;; bold1) printf "$ESC{=b }" ;; @@ -43,9 +45,9 @@ color() { invert) printf "$ESC{=r }" ;; *) if [ "$#" = "2" ]; then - [ "$MONOCHROME" = "1" ] && printf "$ESC{= }" || printf "$ESC{= $1$2}" + [ "$COLOR" = "monochrome" ] && printf "$ESC{= }" || printf "$ESC{= $1$2}" else - [ "$MONOCHROME" = "1" ] && printf "$ESC{=$1 }" || printf "$ESC{=$1 $2$3}" + [ "$COLOR" = "monochrome" ] && printf "$ESC{=$1 }" || printf "$ESC{=$1 $2$3}" fi ;; esac diff --git a/debian/changelog b/debian/changelog index 66db6837..e9722fc5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -73,6 +73,8 @@ byobu (2.40) unreleased; urgency=low - define and use a color function for all status indicators, gives infinite flexibility - replace "undo" with "-" + * byobu-status: allow for no color decorations, helps with older versions + of screen, LP: #432165 -- Dustin Kirkland Tue, 10 Nov 2009 10:18:20 -0600