projects
/
grml-scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3776b2e
)
Enable nocolor support
author
Alexander Wirt
<formorer@grml.org>
Mon, 19 Mar 2007 21:48:41 +0000
(22:48 +0100)
committer
Alexander Wirt
<formorer@grml.org>
Mon, 19 Mar 2007 21:48:41 +0000
(22:48 +0100)
usr_sbin/grml-quickconfig
patch
|
blob
|
history
diff --git
a/usr_sbin/grml-quickconfig
b/usr_sbin/grml-quickconfig
index
49f268b
..
354e3cf
100755
(executable)
--- 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";
# 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
# 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
$HLINE=$B."x".$N; # A single horizontal line drawing character
# menu options