1XRDB(1) General Commands Manual XRDB(1)
2
3
4
6 xrdb - X server resource database utility
7
9 xrdb [-option ...] [filename]
10
12 Xrdb is used to get or set the contents of the RESOURCE_MANAGER prop‐
13 erty on the root window of screen 0, or the SCREEN_RESOURCES property
14 on the root window of any or all screens, or everything combined. You
15 would normally run this program from your X startup file.
16
17 Most X clients use the RESOURCE_MANAGER and SCREEN_RESOURCES properties
18 to get user preferences about color, fonts, and so on for applications.
19 Having this information in the server (where it is available to all
20 clients) instead of on disk, solves the problem in previous versions of
21 X that required you to maintain defaults files on every machine that
22 you might use. It also allows for dynamic changing of defaults without
23 editing files.
24
25 The RESOURCE_MANAGER property is used for resources that apply to all
26 screens of the display. The SCREEN_RESOURCES property on each screen
27 specifies additional (or overriding) resources to be used for that
28 screen. (When there is only one screen, SCREEN_RESOURCES is normally
29 not used, all resources are just placed in the RESOURCE_MANAGER prop‐
30 erty.)
31
32 The file specified by filename (or the contents from standard input if
33 - or no filename is given) is optionally passed through the C pre‐
34 processor with the following symbols defined, based on the capabilities
35 of the server being used:
36
37 SERVERHOST=hostname
38 the hostname portion of the display to which you are connected.
39
40 SRVR_name
41 the SERVERHOST hostname string turned into a legal identifier.
42 For example, "my-dpy.lcs.mit.edu" becomes
43 SRVR_my_dpy_lcs_mit_edu.
44
45 HOST=hostname
46 the same as SERVERHOST.
47
48 DISPLAY_NUM=num
49 the number of the display on the server host.
50
51 CLIENTHOST=hostname
52 the name of the host on which xrdb is running.
53
54 CLNT_name
55 the CLIENTHOST hostname string turned into a legal identifier.
56 For example, "expo.lcs.mit.edu" becomes CLNT_expo_lcs_mit_edu.
57
58 RELEASE=num
59 the vendor release number for the server. The interpretation
60 of this number will vary depending on VENDOR.
61
62 REVISION=num
63 the X protocol minor version supported by this server (cur‐
64 rently 0).
65
66 VERSION=num
67 the X protocol major version supported by this server (should
68 always be 11).
69
70 VENDOR="vendor"
71 a string literal specifying the vendor of the server.
72
73 VNDR_name
74 the VENDOR name string turned into a legal identifier. For
75 example, "MIT X Consortium" becomes VNDR_MIT_X_Consortium.
76
77 EXT_name
78 A symbol is defined for each protocol extension supported by
79 the server. Each extension string name is turned into a legal
80 identifier. For example, "X3D-PEX" becomes EXT_X3D_PEX.
81
82 NUM_SCREENS=num
83 the total number of screens.
84
85 SCREEN_NUM=num
86 the number of the current screen (from zero).
87
88 BITS_PER_RGB=num
89 the number of significant bits in an RGB color specification.
90 This is the log base 2 of the number of distinct shades of each
91 primary that the hardware can generate. Note that it usually
92 is not related to PLANES.
93
94 CLASS=visualclass
95 one of StaticGray, GrayScale, StaticColor, PseudoColor, True‐
96 Color, DirectColor. This is the visual class of the root win‐
97 dow.
98
99 CLASS_visualclass=visualid
100 the visual class of the root window in a form you can #ifdef
101 on. The value is the numeric id of the visual.
102
103 COLOR defined only if CLASS is one of StaticColor, PseudoColor, True‐
104 Color, or DirectColor.
105
106 CLASS_visualclass_depth=num
107 A symbol is defined for each visual supported for the screen.
108 The symbol includes the class of the visual and its depth; the
109 value is the numeric id of the visual. (If more than one vis‐
110 ual has the same class and depth, the numeric id of the first
111 one reported by the server is used.)
112
113 HEIGHT=num
114 the height of the root window in pixels.
115
116 WIDTH=num
117 the width of the root window in pixels.
118
119 PLANES=num
120 the number of bit planes (the depth) of the root window.
121
122 X_RESOLUTION=num
123 the x resolution of the screen in pixels per meter.
124
125 Y_RESOLUTION=num
126 the y resolution of the screen in pixels per meter.
127
128 SRVR_name, CLNT_name, VNDR_name, and EXT_name identifiers are formed by
129 changing all characters other than letters and digits into underscores
130 (_).
131
132 Lines that begin with an exclamation mark (!) are ignored and may be
133 used as comments.
134
135 Note that since xrdb can read from standard input, it can be used to
136 the change the contents of properties directly from a terminal or from
137 a shell script.
138
140 xrdb program accepts the following options:
141
142 -help This option (or any unsupported option) will cause a brief
143 description of the allowable options and parameters to be
144 printed.
145
146 -version
147 This option will cause the xrdb version to be printed and the
148 program to exit without performing any other operations.
149
150 -display display
151 This option specifies the X server to be used; see X(7). It
152 also specifies the screen to use for the -screen option, and it
153 specifies the screen from which preprocessor symbols are
154 derived for the -global option.
155
156 -all This option indicates that operation should be performed on the
157 screen-independent resource property (RESOURCE_MANAGER), as
158 well as the screen-specific property (SCREEN_RESOURCES) on
159 every screen of the display. For example, when used in con‐
160 junction with -query, the contents of all properties are out‐
161 put. For -load, -override and -merge, the input file is pro‐
162 cessed once for each screen. The resources which occur in com‐
163 mon in the output for every screen are collected, and these are
164 applied as the screen-independent resources. The remaining
165 resources are applied for each individual per-screen property.
166 This the default mode of operation.
167
168 -global This option indicates that the operation should only be per‐
169 formed on the screen-independent RESOURCE_MANAGER property.
170
171 -screen This option indicates that the operation should only be per‐
172 formed on the SCREEN_RESOURCES property of the default screen
173 of the display.
174
175 -screens
176 This option indicates that the operation should be performed on
177 the SCREEN_RESOURCES property of each screen of the display.
178 For -load, -override and -merge, the input file is processed
179 for each screen.
180
181 -n This option indicates that changes to the specified properties
182 (when used with -load, -override or -merge) or to the resource
183 file (when used with -edit) should be shown on the standard
184 output, but should not be performed.
185
186 -quiet This option indicates that warning about duplicate entries
187 should not be displayed.
188
189 -cpp filename
190 This option specifies the pathname of the C preprocessor pro‐
191 gram to be used. Although xrdb was designed to use CPP, any
192 program that acts as a filter and accepts the -D, -I, and -U
193 options may be used.
194
195 -nocpp This option indicates that xrdb should not run the input file
196 through a preprocessor before loading it into properties.
197
198 -undef This option is passed to the C preprocessor if used. It pre‐
199 vents it from predefining any system specific macros.
200
201 -symbols
202 This option indicates that the symbols that are defined for the
203 preprocessor should be printed onto the standard output.
204
205 -query This option indicates that the current contents of the speci‐
206 fied properties should be printed onto the standard output.
207 Note that since preprocessor commands in the input resource
208 file are part of the input file, not part of the property, they
209 won't appear in the output from this option. The -edit option
210 can be used to merge the contents of properties back into the
211 input resource file without damaging preprocessor commands.
212
213 -load This option indicates that the input should be loaded as the
214 new value of the specified properties, replacing whatever was
215 there (i.e. the old contents are removed). This is the
216 default action.
217
218 -override
219 This option indicates that the input should be added to,
220 instead of replacing, the current contents of the specified
221 properties. New entries override previous entries.
222
223 -merge This option indicates that the input should be merged and lexi‐
224 cographically sorted with, instead of replacing, the current
225 contents of the specified properties.
226
227 -remove This option indicates that the specified properties should be
228 removed from the server.
229
230 -retain This option indicates that the server should be instructed not
231 to reset if xrdb is the first client. This should never be
232 necessary under normal conditions, since xdm and xinit always
233 act as the first client.
234
235 -edit filename
236 This option indicates that the contents of the specified prop‐
237 erties should be edited into the given file, replacing any val‐
238 ues already listed there. This allows you to put changes that
239 you have made to your defaults back into your resource file,
240 preserving any comments or preprocessor lines.
241
242 -backup string
243 This option specifies a suffix to be appended to the filename
244 used with -edit to generate a backup file.
245
246 -Dname[=value]
247 This option is passed through to the preprocessor and is used
248 to define symbols for use with conditionals such as #ifdef.
249
250 -Uname This option is passed through to the preprocessor and is used
251 to remove any definitions of this symbol.
252
253 -Idirectory
254 This option is passed through to the preprocessor and is used
255 to specify a directory to search for files that are referenced
256 with #include.
257
259 Xrdb does not load any files on its own, but many desktop environments
260 use xrdb to load ~/.Xresources files on session startup to initialize
261 the resource database, as a generalized replacement for ~/.Xdefaults
262 files.
263
265 X(7), appres(1), listres(1), Xlib Resource Manager documentation, Xt
266 resource documentation
267
269 DISPLAY to figure out which display to use.
270
272 The default for no arguments should be to query, not to overwrite, so
273 that it is consistent with other programs.
274
276 Bob Scheifler, Phil Karlton, rewritten from the original by Jim Gettys
277
278
279
280X Version 11 xrdb 1.1.0 XRDB(1)