From a40272445f7ab16b264c87f7393bfb76dbcad9df Mon Sep 17 00:00:00 2001 From: Alexander Wirt Date: Mon, 19 Mar 2007 22:48:41 +0100 Subject: [PATCH] Enable nocolor support --- usr_sbin/grml-quickconfig | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/usr_sbin/grml-quickconfig b/usr_sbin/grml-quickconfig index 49f268b..354e3cf 100755 --- a/usr_sbin/grml-quickconfig +++ b/usr_sbin/grml-quickconfig @@ -12,11 +12,23 @@ # enable alternate charset support (needed for screen) print "\e(B\e)0"; +open (my $fh, '/proc/cmdline'); +my $cmdline = <$fh>; +close($fh); + +my $color = 1 unless $cmdline =~ /nocolor/; + # variables for nice display -$W = "\e[0;32;1m"; # White -$N = "\x0f\e[0m"; # Normal -$M = "\e[0;35;1m"; # Magenta (for commands) -$B = "\e[0;34;1m\x0e"; # Blue, line drawing characters +if ($color) { + $W = "\e[0;32;1m"; # White + $N = "\x0f\e[0m"; # Normal + $M = "\e[0;35;1m"; # Magenta (for commands) + $B = "\e[0;34;1m\x0e"; # Blue, line drawing characters +} else { + $B = "\x0e"; + $N = "\x0f"; +} + $HLINE=$B."x".$N; # A single horizontal line drawing character # menu options -- 2.1.4