blob: 66ecf2c4860278a3cc283dafb00b1b0e922b7669 [file] [log] [blame]
bigbiff7b4c7a62015-01-01 19:44:14 -05001.\" terminal-colors.d.5 --
2.\" Copyright 2014 Ondrej Oprala <ooprala@redhat.com>
3.\" Copyright (C) 2014 Karel Zak <kzak@redhat.com>
4.\" Copyright 2014 Red Hat, Inc.
5.\" May be distributed under the GNU General Public License
6.TH "TERMINAL_COLORS.D" "5" "January 2014" "util-linux" "terminal-colors.d"
7.SH "NAME"
8terminal-colors.d \- Configure output colorization for various utilities
9.SH "SYNOPSIS"
10/etc/terminal-colors\&.d/[[\fIname\fR][@\fIterm\fR]\&.][\fItype\fR]
11.SH "DESCRIPTION"
12Files in this directory determine the default behavior for utilities
13when coloring output.
14
15The
16.I name
17is a utility name. The name is optional and when none is specified then the
18file is used for all unspecified utilities.
19
20The
21.I term
22is a terminal identifier (the TERM environment variable).
23The terminal identifier is optional and when none is specified then the file
24is used for all unspecified terminals.
25
26The
27.I type
28is a file type. Supported file types are:
29.TP
30.B disable
31Turns off output colorization for all compatible utilities.
32.TP
33.B enable
34Turns on output colorization; any matching
35.B disable
36files are ignored.
37.TP
38.B scheme
39Specifies colors used for output. The file format may be specific to the utility,
40the default format is described below.
41.PP
42If there are more files that match for a utility, then the file with the more
43specific filename wins. For example, the filename "@xterm.scheme" has less
44priority than "dmesg@xterm.scheme". The lowest priority are those files without a
45utility name and terminal identifier (e.g. "disable").
46
47The user-specific
48.I $XDG_CONFIG_HOME/terminal-colors.d
49or
50.I $HOME/.config/terminal-colors.d
51overrides the global setting.
52
53.SH EXAMPLES
54Disable colors for all compatible utilities:
55.RS
56.br
57.B "touch /etc/terminal-colors.d/disable"
58.br
59.RE
60
61Disable colors for all compatible utils on a vt100 terminal:
62.RS
63.br
64.B "touch /etc/terminal-colors.d/@vt100.disable"
65.br
66.RE
67
68Disable colors for all compatible utils except dmesg(1):
69.RS
70.br
71.B "touch /etc/terminal-colors.d/disable"
72.sp
73.B "touch /etc/terminal-colors.d/dmesg.enable"
74.br
75.RE
76
77.SH DEFAULT SCHEME FILES FORMAT
78The following statement is recognized:
79
80.RS
81.br
82.B "name color-sequence"
83.br
84.RE
85
86The
87.B name
88is a logical name of color sequence (for example "error"). The names are
89specific to the utilities. For more details always see the COLORS section
90in the man page for the utility.
91
92The
93.B color-sequence
94is a color name, ASCII color sequences or escape sequences.
95
96.SS Color names
97black, blue, brown, cyan, darkgray, gray, green, lightblue, lightcyan
98lightgray, lightgreen, lightmagenta, lightred, magenta, red and yellow
99.SS ANSI color sequences
100The color sequences are composed of sequences of numbers
101separated by semicolons. The most common codes are:
102.sp
103.RS
104.TS
105l l.
106 0 to restore default color
107 1 for brighter colors
108 4 for underlined text
109 5 for flashing text
11030 for black foreground
11131 for red foreground
11232 for green foreground
11333 for yellow (or brown) foreground
11434 for blue foreground
11535 for purple foreground
11636 for cyan foreground
11737 for white (or gray) foreground
11840 for black background
11941 for red background
12042 for green background
12143 for yellow (or brown) background
12244 for blue background
12345 for purple background
12446 for cyan background
12547 for white (or gray) background
126.TE
127.RE
128.SS Escape sequences
129To specify control or blank characters in the color sequences,
130C-style \e-escaped notation can be used:
131.sp
132.RS
133.TS
134lb l.
135\ea Bell (ASCII 7)
136\eb Backspace (ASCII 8)
137\ee Escape (ASCII 27)
138\ef Form feed (ASCII 12)
139\en Newline (ASCII 10)
140\er Carriage Return (ASCII 13)
141\et Tab (ASCII 9)
142\ev Vertical Tab (ASCII 11)
143\e? Delete (ASCII 127)
144\e_ Space
145\e\e Backslash (\e)
146\e^ Caret (^)
147\e# Hash mark (#)
148.TE
149.RE
150.sp
151Please note that escapes are necessary to enter a space, backslash,
152caret, or any control character anywhere in the string, as well as a
153hash mark as the first character.
154
155For example, to use a red background for alert messages in the output of
156.BR dmesg (1),
157use:
158
159.RS
160.br
161.B "echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme"
162.br
163.RE
164
165.SS Comments
166Lines where the first non-blank character is a # (hash) are ignored.
167Any other use of the hash character is not interpreted as introducing
168a comment.
169
170.SH FILES
171.B $XDG_CONFIG_HOME/terminal-colors.d
172.br
173.B $HOME/.config/terminal-colors.d
174.br
175.B /etc/terminal-colors.d
176
177.SH ENVIRONMENT
178.IP TERMINAL_COLORS_DEBUG=all
179enables debug output.
180
181.SH COMPATIBILITY
182The terminal-colors.d functionality is currently supported by all util-linux
183utilities which provides colorized output. For more details always see the
184COLORS section in the man page for the utility.
185
186.SH AVAILABILITY
187terminal-colors.d is part of the util-linux package and is available from
188.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
189Linux Kernel Archive
190.UE .