man-pages/man5/terminal-colors.d.5.html
2021-03-31 01:06:50 +01:00

294 lines
8.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of TERMINAL_COLORS.D</TITLE>
</HEAD><BODY>
<H1>TERMINAL_COLORS.D</H1>
Section: terminal-colors.d (5)<BR>Updated: January 2014<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
terminal-colors.d - Configure output colorization for various utilities
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
/etc/terminal-colors.d/[[<I>name</I>][@<I>term</I>].][<I>type</I>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
Files in this directory determine the default behavior for utilities
when coloring output.
<P>
The
<I>name</I>
is a utility name. The name is optional and when none is specified then the
file is used for all unspecified utilities.
<P>
The
<I>term</I>
is a terminal identifier (the TERM environment variable).
The terminal identifier is optional and when none is specified then the file
is used for all unspecified terminals.
<P>
The
<I>type</I>
is a file type. Supported file types are:
<DL COMPACT>
<DT id="1"><B>disable</B>
<DD>
Turns off output colorization for all compatible utilities.
<DT id="2"><B>enable</B>
<DD>
Turns on output colorization; any matching
<B>disable</B>
files are ignored.
<DT id="3"><B>scheme</B>
<DD>
Specifies colors used for output. The file format may be specific to the utility,
the default format is described below.
</DL>
<P>
If there are more files that match for a utility, then the file with the more
specific filename wins. For example, the filename &quot;@xterm.scheme&quot; has less
priority than &quot;<A HREF="mailto:dmesg@xterm.scheme">dmesg@xterm.scheme</A>&quot;. The lowest priority are those files without a
utility name and terminal identifier (e.g. &quot;disable&quot;).
<P>
The user-specific
<I>$XDG_CONFIG_HOME/terminal-colors.d</I>
or
<I>$HOME/.config/terminal-colors.d</I>
overrides the global setting.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>EXAMPLES</H2>
Disable colors for all compatible utilities:
<DL COMPACT><DT id="4"><DD>
<BR>
<B>touch /etc/terminal-colors.d/disable</B>
<BR>
</DL>
<P>
Disable colors for all compatible utils on a vt100 terminal:
<DL COMPACT><DT id="5"><DD>
<BR>
<B>touch /etc/terminal-colors.d/@vt100.disable</B>
<BR>
</DL>
<P>
Disable colors for all compatible utils except <A HREF="/cgi-bin/man/man2html?1+dmesg">dmesg</A>(1):
<DL COMPACT><DT id="6"><DD>
<BR>
<B>touch /etc/terminal-colors.d/disable</B>
<P>
<B>touch /etc/terminal-colors.d/dmesg.enable</B>
<BR>
</DL>
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>DEFAULT SCHEME FILES FORMAT</H2>
The following statement is recognized:
<P>
<DL COMPACT><DT id="7"><DD>
<BR>
<B>name color-sequence</B>
<BR>
</DL>
<P>
The
<B>name</B>
is a logical name of color sequence (for example &quot;error&quot;). The names are
specific to the utilities. For more details always see the COLORS section
in the man page for the utility.
<P>
The
<B>color-sequence</B>
is a color name, ASCII color sequences or escape sequences.
<P>
<A NAME="lbAG">&nbsp;</A>
<H3>Color names</H3>
black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright,
lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta,
red, reset, reverse, and yellow.
<P>
<A NAME="lbAH">&nbsp;</A>
<H3>ANSI color sequences</H3>
The color sequences are composed of sequences of numbers
separated by semicolons. The most common codes are:
<P>
<DL COMPACT><DT id="8"><DD>
<TABLE>
<TR VALIGN=top><TD><BR>&nbsp;0</TD><TD>to restore default color<BR></TD></TR>
<TR VALIGN=top><TD><BR>&nbsp;1</TD><TD>for brighter colors<BR></TD></TR>
<TR VALIGN=top><TD><BR>&nbsp;4</TD><TD>for underlined text<BR></TD></TR>
<TR VALIGN=top><TD><BR>&nbsp;5</TD><TD>for flashing text<BR></TD></TR>
<TR VALIGN=top><TD>30</TD><TD>for black foreground<BR></TD></TR>
<TR VALIGN=top><TD>31</TD><TD>for red foreground<BR></TD></TR>
<TR VALIGN=top><TD>32</TD><TD>for green foreground<BR></TD></TR>
<TR VALIGN=top><TD>33</TD><TD>for yellow (or brown) foreground<BR></TD></TR>
<TR VALIGN=top><TD>34</TD><TD>for blue foreground<BR></TD></TR>
<TR VALIGN=top><TD>35</TD><TD>for purple foreground<BR></TD></TR>
<TR VALIGN=top><TD>36</TD><TD>for cyan foreground<BR></TD></TR>
<TR VALIGN=top><TD>37</TD><TD>for white (or gray) foreground<BR></TD></TR>
<TR VALIGN=top><TD>40</TD><TD>for black background<BR></TD></TR>
<TR VALIGN=top><TD>41</TD><TD>for red background<BR></TD></TR>
<TR VALIGN=top><TD>42</TD><TD>for green background<BR></TD></TR>
<TR VALIGN=top><TD>43</TD><TD>for yellow (or brown) background<BR></TD></TR>
<TR VALIGN=top><TD>44</TD><TD>for blue background<BR></TD></TR>
<TR VALIGN=top><TD>45</TD><TD>for purple background<BR></TD></TR>
<TR VALIGN=top><TD>46</TD><TD>for cyan background<BR></TD></TR>
<TR VALIGN=top><TD>47</TD><TD>for white (or gray) background<BR></TD></TR>
</TABLE>
</DL>
<A NAME="lbAI">&nbsp;</A>
<H3>Escape sequences</H3>
To specify control or blank characters in the color sequences,
C-style \-escaped notation can be used:
<P>
<DL COMPACT><DT id="9"><DD>
<TABLE>
<TR VALIGN=top><TD><B>\a</B></TD><TD>Bell (ASCII 7)<BR></TD></TR>
<TR VALIGN=top><TD><B>\b</B></TD><TD>Backspace (ASCII 8)<BR></TD></TR>
<TR VALIGN=top><TD><B>\e</B></TD><TD>Escape (ASCII 27)<BR></TD></TR>
<TR VALIGN=top><TD><B>\f</B></TD><TD>Form feed (ASCII 12)<BR></TD></TR>
<TR VALIGN=top><TD><B>\n</B></TD><TD>Newline (ASCII 10)<BR></TD></TR>
<TR VALIGN=top><TD><B>\r</B></TD><TD>Carriage Return (ASCII 13)<BR></TD></TR>
<TR VALIGN=top><TD><B>\t</B></TD><TD>Tab (ASCII 9)<BR></TD></TR>
<TR VALIGN=top><TD><B>\v</B></TD><TD>Vertical Tab (ASCII 11)<BR></TD></TR>
<TR VALIGN=top><TD><B>\?</B></TD><TD>Delete (ASCII 127)<BR></TD></TR>
<TR VALIGN=top><TD><B>\_</B></TD><TD>Space<BR></TD></TR>
<TR VALIGN=top><TD><B>\\</B></TD><TD>Backslash (\)<BR></TD></TR>
<TR VALIGN=top><TD><B>\^</B></TD><TD>Caret (^)<BR></TD></TR>
<TR VALIGN=top><TD><B>\#</B></TD><TD>Hash mark (#)<BR></TD></TR>
</TABLE>
</DL>
<P>
Please note that escapes are necessary to enter a space, backslash,
caret, or any control character anywhere in the string, as well as a
hash mark as the first character.
<P>
For example, to use a red background for alert messages in the output of
<B><A HREF="/cgi-bin/man/man2html?1+dmesg">dmesg</A></B>(1),
use:
<P>
<DL COMPACT><DT id="10"><DD>
<BR>
<B>echo 'alert 37;41' &gt;&gt; /etc/terminal-colors.d/dmesg.scheme</B>
<BR>
</DL>
<P>
<A NAME="lbAJ">&nbsp;</A>
<H3>Comments</H3>
Lines where the first non-blank character is a # (hash) are ignored.
Any other use of the hash character is not interpreted as introducing
a comment.
<P>
<A NAME="lbAK">&nbsp;</A>
<H2>FILES</H2>
<I>$XDG_CONFIG_HOME/terminal-colors.d</I>
<BR>
<I>$HOME/.config/terminal-colors.d</I>
<BR>
<I>/etc/terminal-colors.d</I>
<P>
<A NAME="lbAL">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<DL COMPACT>
<DT id="11">TERMINAL_COLORS_DEBUG=all<DD>
enables debug output.
<P>
</DL>
<A NAME="lbAM">&nbsp;</A>
<H2>COMPATIBILITY</H2>
The terminal-colors.d functionality is currently supported by all util-linux
utilities which provides colorized output. For more details always see the
COLORS section in the man page for the utility.
<P>
<A NAME="lbAN">&nbsp;</A>
<H2>AVAILABILITY</H2>
terminal-colors.d is part of the util-linux package and is available from
Linux Kernel Archive
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="12"><A HREF="#lbAB">NAME</A><DD>
<DT id="13"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="14"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="15"><A HREF="#lbAE">EXAMPLES</A><DD>
<DT id="16"><A HREF="#lbAF">DEFAULT SCHEME FILES FORMAT</A><DD>
<DL>
<DT id="17"><A HREF="#lbAG">Color names</A><DD>
<DT id="18"><A HREF="#lbAH">ANSI color sequences</A><DD>
<DT id="19"><A HREF="#lbAI">Escape sequences</A><DD>
<DT id="20"><A HREF="#lbAJ">Comments</A><DD>
</DL>
<DT id="21"><A HREF="#lbAK">FILES</A><DD>
<DT id="22"><A HREF="#lbAL">ENVIRONMENT</A><DD>
<DT id="23"><A HREF="#lbAM">COMPATIBILITY</A><DD>
<DT id="24"><A HREF="#lbAN">AVAILABILITY</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:06 GMT, March 31, 2021
</BODY>
</HTML>