]>
Commit | Line | Data |
---|---|---|
295b3979 | 1 | //po4a: entry man manual |
e2db4d94 MB |
2 | //// |
3 | terminal-colors.d.5 -- | |
4 | Copyright 2014 Ondrej Oprala <ooprala@redhat.com> | |
5 | Copyright (C) 2014 Karel Zak <kzak@redhat.com> | |
6 | Copyright 2014 Red Hat, Inc. | |
7 | May be distributed under the GNU General Public License | |
8 | //// | |
9 | ||
10 | = terminal-colors.d(5) | |
11 | :doctype: manpage | |
12 | :man manual: File formats | |
13 | :man source: util-linux {release-version} | |
14 | :page-layout: base | |
15 | :configfile: terminal-colors.d | |
16 | ||
17 | == NAME | |
18 | ||
19 | terminal-colors.d - configure output colorization for various utilities | |
20 | ||
21 | == SYNOPSIS | |
22 | ||
23 | /etc/terminal-colors.d/_[[name][@term].][type]_ | |
24 | ||
25 | == DESCRIPTION | |
26 | ||
27 | Files in this directory determine the default behavior for utilities when coloring output. | |
28 | ||
29 | The _name_ is a utility name. The name is optional and when none is specified then the file is used for all unspecified utilities. | |
30 | ||
e6743239 | 31 | The _term_ 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. |
e2db4d94 MB |
32 | |
33 | The _type_ is a file type. Supported file types are: | |
34 | ||
35 | *disable*:: | |
ea81716d | 36 | Turns off output colorization for all compatible utilities. |
e2db4d94 MB |
37 | |
38 | *enable*:: | |
ea81716d | 39 | Turns on output colorization; any matching *disable* files are ignored. |
e2db4d94 MB |
40 | |
41 | *scheme*:: | |
ea81716d | 42 | Specifies colors used for output. The file format may be specific to the utility, the default format is described below. |
e2db4d94 MB |
43 | |
44 | If there are more files that match for a utility, then the file with the more specific filename wins. For example, the filename "@xterm.scheme" has less priority than "dmesg@xterm.scheme". The lowest priority are those files without a utility name and terminal identifier (e.g., "disable"). | |
45 | ||
46 | The user-specific _$XDG_CONFIG_HOME/terminal-colors.d_ or _$HOME/.config/terminal-colors.d_ overrides the global setting. | |
47 | ||
e2db4d94 MB |
48 | == DEFAULT SCHEME FILES FORMAT |
49 | ||
50 | The following statement is recognized: | |
51 | ||
52 | ____ | |
53 | *name color-sequence* | |
54 | ____ | |
55 | ||
c83a52f0 | 56 | The *name* is a logical name of color sequence (for example "error"). The names are specific to the utilities. For more details always see the *COLORS* section in the man page for the utility. |
e2db4d94 MB |
57 | |
58 | The *color-sequence* is a color name, ASCII color sequences or escape sequences. | |
59 | ||
e2db4d94 MB |
60 | === Color names |
61 | ||
62 | black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright, lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta, red, reset, reverse, and yellow. | |
63 | ||
e2db4d94 MB |
64 | === ANSI color sequences |
65 | ||
66 | The color sequences are composed of sequences of numbers separated by semicolons. The most common codes are: | |
67 | ||
68 | ____ | |
69 | [cols=",",] | |
70 | |=== | |
71 | |0 |to restore default color | |
72 | |1 |for brighter colors | |
73 | |4 |for underlined text | |
74 | |5 |for flashing text | |
75 | |30 |for black foreground | |
76 | |31 |for red foreground | |
77 | |32 |for green foreground | |
78 | |33 |for yellow (or brown) foreground | |
79 | |34 |for blue foreground | |
80 | |35 |for purple foreground | |
81 | |36 |for cyan foreground | |
82 | |37 |for white (or gray) foreground | |
83 | |40 |for black background | |
84 | |41 |for red background | |
85 | |42 |for green background | |
86 | |43 |for yellow (or brown) background | |
87 | |44 |for blue background | |
88 | |45 |for purple background | |
89 | |46 |for cyan background | |
90 | |47 |for white (or gray) background | |
91 | |=== | |
92 | ____ | |
93 | ||
e2db4d94 MB |
94 | === Escape sequences |
95 | ||
4d297435 | 96 | To specify control or blank characters in the color sequences, C-style \-escaped notation can be used: |
e2db4d94 MB |
97 | |
98 | ____ | |
99 | [cols=",",] | |
100 | |=== | |
4d297435 MB |
101 | |*\a* |Bell (ASCII 7) |
102 | |*\b* |Backspace (ASCII 8) | |
103 | |*\e* |Escape (ASCII 27) | |
104 | |*\f* |Form feed (ASCII 12) | |
105 | |*\n* |Newline (ASCII 10) | |
106 | |*\r* |Carriage Return (ASCII 13) | |
107 | |*\t* |Tab (ASCII 9) | |
108 | |*\v* |Vertical Tab (ASCII 11) | |
109 | |*\?* |Delete (ASCII 127) | |
110 | |*\_* |Space | |
111 | |*\\* |Backslash (\) | |
112 | |*\^* |Caret (^) | |
113 | |*\#* |Hash mark (#) | |
e2db4d94 MB |
114 | |=== |
115 | ____ | |
116 | ||
117 | 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. | |
118 | ||
119 | For example, to use a red background for alert messages in the output of *dmesg*(1), use: | |
120 | ||
121 | ____ | |
122 | *echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme* | |
123 | ____ | |
124 | ||
125 | === Comments | |
126 | ||
127 | 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. | |
128 | ||
129 | == ENVIRONMENT | |
130 | ||
e6743239 | 131 | *TERMINAL_COLORS_DEBUG*=all:: |
ea81716d | 132 | enables debug output. |
e2db4d94 MB |
133 | |
134 | == FILES | |
135 | ||
136 | _$XDG_CONFIG_HOME/terminal-colors.d_ | |
ea81716d | 137 | |
e2db4d94 | 138 | _$HOME/.config/terminal-colors.d_ |
ea81716d | 139 | |
e2db4d94 MB |
140 | _/etc/terminal-colors.d_ |
141 | ||
142 | == EXAMPLE | |
143 | ||
144 | Disable colors for all compatible utilities: | |
145 | ||
146 | ____ | |
147 | *touch /etc/terminal-colors.d/disable* | |
148 | ____ | |
149 | ||
150 | Disable colors for all compatible utils on a vt100 terminal: | |
151 | ||
152 | ____ | |
153 | *touch /etc/terminal-colors.d/@vt100.disable* | |
154 | ____ | |
155 | ||
156 | Disable colors for all compatible utils except *dmesg*(1): | |
157 | ||
158 | ____ | |
159 | *touch /etc/terminal-colors.d/disable* | |
160 | ||
161 | *touch /etc/terminal-colors.d/dmesg.enable* | |
162 | ____ | |
163 | ||
164 | == COMPATIBILITY | |
165 | ||
421a482a | 166 | 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. |
e2db4d94 | 167 | |
625e9c61 | 168 | include::man-common/bugreports.adoc[] |
e2db4d94 | 169 | |
625e9c61 | 170 | include::man-common/footer-config.adoc[] |
e2db4d94 MB |
171 | |
172 | ifdef::translation[] | |
625e9c61 | 173 | include::man-common/translation.adoc[] |
e2db4d94 | 174 | endif::[] |