Enable nocolor support
authorAlexander Wirt <formorer@grml.org>
Mon, 19 Mar 2007 21:48:41 +0000 (22:48 +0100)
committerAlexander Wirt <formorer@grml.org>
Mon, 19 Mar 2007 21:48:41 +0000 (22:48 +0100)
usr_sbin/grml-quickconfig

index 49f268b..354e3cf 100755 (executable)
 # 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