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 ex‐
75 ample, "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 de‐
143 scription 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 de‐
154 rived 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 ev‐
159 ery screen of the display. For example, when used in conjunc‐
160 tion with -query, the contents of all properties are output.
161 For -load, -override and -merge, the input file is processed
162 once for each screen. The resources which occur in common in
163 the output for every screen are collected, and these are ap‐
164 plied as the screen-independent resources. The remaining re‐
165 sources 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 -E This option indicates that any cpp command run and the output
202 from it should be shown on standard output. If -nocpp was also
203 specified, the input file will be shown as read. The specified
204 changes will also be performed unless the -n option is also
205 specified.
206
207 -symbols
208 This option indicates that the symbols that are defined for the
209 preprocessor should be printed onto the standard output.
210
211 -query This option indicates that the current contents of the speci‐
212 fied properties should be printed onto the standard output.
213 Note that since preprocessor commands in the input resource
214 file are part of the input file, not part of the property, they
215 won't appear in the output from this option. The -edit option
216 can be used to merge the contents of properties back into the
217 input resource file without damaging preprocessor commands.
218
219 -get name
220 This option indicates that the current content of the property
221 matching name should be printed onto the standard output.
222
223 -load This option indicates that the input should be loaded as the
224 new value of the specified properties, replacing whatever was
225 there (i.e. the old contents are removed). This is the de‐
226 fault action.
227
228 -override
229 This option indicates that the input should be added to, in‐
230 stead of replacing, the current contents of the specified prop‐
231 erties. New entries override previous entries.
232
233 -merge This option indicates that the input should be merged and lexi‐
234 cographically sorted with, instead of replacing, the current
235 contents of the specified properties.
236
237 -remove This option indicates that the specified properties should be
238 removed from the server.
239
240 -retain This option indicates that the server should be instructed not
241 to reset if xrdb is the first client. This should never be
242 necessary under normal conditions, since xdm and xinit always
243 act as the first client.
244
245 -edit filename
246 This option indicates that the contents of the specified prop‐
247 erties should be edited into the given file, replacing any val‐
248 ues already listed there. This allows you to put changes that
249 you have made to your defaults back into your resource file,
250 preserving any comments or preprocessor lines.
251
252 -backup string
253 This option specifies a suffix to be appended to the filename
254 used with -edit to generate a backup file.
255
256 -Dname[=value]
257 This option is passed through to the preprocessor and is used
258 to define symbols for use with conditionals such as #ifdef.
259
260 -Uname This option is passed through to the preprocessor and is used
261 to remove any definitions of this symbol.
262
263 -Idirectory
264 This option is passed through to the preprocessor and is used
265 to specify a directory to search for files that are referenced
266 with #include.
267
269 Xrdb does not load any files on its own, but many desktop environments
270 use xrdb to load ~/.Xresources files on session startup to initialize
271 the resource database, as a generalized replacement for ~/.Xdefaults
272 files.
273
275 X(7), appres(1), listres(1), Xlib Resource Manager documentation, Xt
276 resource documentation
277
279 DISPLAY to figure out which display to use.
280
282 The default for no arguments should be to query, not to overwrite, so
283 that it is consistent with other programs.
284
286 Bob Scheifler, Phil Karlton, rewritten from the original by Jim Gettys
287
288
289
290X Version 11 xrdb 1.2.2 XRDB(1)