[arch-projects] [initscripts] background color in /sbin/rc

Kwpolska kwpolska at gmail.com
Sat May 7 11:39:20 CEST 2011


On Wed, May 04, 2011 at 02:05:12AM +0300, Grigorios Bouzakis wrote:
> But despite that the proposed scheme doesn't work in white terminals.
> See attached screenshot. Sorry for the multiple emails.
> 
> ----
> Greg

Well, this patch seems to be incorrect, but I think I can find a
better one.  The current way of rc.d scripts' display is *forcing*
white bold text.  But this is not the right way, we shall display the
current text color in bold.  This is possible thanks to this code:

    \033[1m

The next thing to do with this one is to find a nice color that will
work fine in $C_H2.  It's (most of the time) a light cyan color,
barely readable on a white terminal.

A patch resolving *most* of the issues (expect $C_H2) is included.
-- 
Cheers,
-- Kwpolska (http://kwpolska.co.cc)
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
-------------- next part --------------
diff --git a/functions.orig b/functions
index fd0928e..66eb953 100644
--- a/functions.orig
+++ b/functions
@@ -51,18 +51,18 @@ fi
 
 # colors:
 if [[ $USECOLOR = YES || $USECOLOR = yes ]]; then
-	C_MAIN="\033[1;37;40m"      # main text
+	C_MAIN="\033[1m"            # main text
 
-	C_OTHER="\033[1;34;40m"     # prefix & brackets
-	C_SEPARATOR="\033[1;30;40m" # separator
+	C_OTHER="\033[1;34m"        # prefix & brackets
+	C_SEPARATOR="\033[1;30m"    # separator
 
-	C_BUSY="\033[0;36;40m"      # busy
-	C_FAIL="\033[1;31;40m"      # failed
-	C_DONE="\033[1;37;40m"      # completed
-	C_BKGD="\033[1;35;40m"      # backgrounded
+	C_BUSY="\033[0;36m"         # busy
+	C_FAIL="\033[1;31m"         # failed
+	C_DONE="\033[1m"            # completed
+	C_BKGD="\033[1;35m"         # backgrounded
 
-	C_H1="\033[1;37;40m"        # highlight text 1
-	C_H2="\033[1;36;40m"        # highlight text 2
+	C_H1="\033[1m"              # highlight text 1
+	C_H2="\033[1;36m"           # highlight text 2
 
 	C_CLEAR="\033[1;0m"
 fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/arch-projects/attachments/20110507/fb0eae48/attachment.asc>


More information about the arch-projects mailing list