.TH xrdb "" "" "X Utility"
.PC "Read/set the X server's resource data base"
\fBxrdb [\-\fIoption ...\^\fB] [\fIfile\^\fB]\fR
.PP
.HS
.SH Options:
.IC \fB\-all\fR
Manipulate the  screen-independent resource property (\fBRESOURCE_MANAGER\fR),
as well as the screen-specific property (\fBSCREEN_RESOURCES\fR)
on every screen of the display
.IC "\fB\-backup \fIstring\fR"
Generate a backup file
.IC "\fB\-cpp \fIpathname\fR"
Name the C preprocessor program to use
.IC "\fB\-D\fIsymbol\^\fB[=\fIvalue\^\fB]\fR"
Pass this option to the preprocessor to define
.I symbol
.IC "\fB\-display \fIdisplay\fR"
Set the X server to be used
.IC "\fB\-edit \fIfile\fR"
Edit the contents of the specified properties into the given file,
replacing any values listed therein
.IC \fB\-help\fR
Print a brief description of these options
.IC \fB\-global\fR
Perform the operation only on the property
.B RESOURCE_MANAGER
.IC "\fB\-I\fIdirectory\fR"
Tell
.B cpp
to search
.I directory
for header files
.IC \fB\-load\fR
Load the input as the new value of the specified properties
.IC \fB\-merge\fR
Merge the input into the contents of the specified properties
rather than replacing the current contents
.IC \fB\-n\fR
Show changes to the specified properties,
but do not execute them
.IC \fB\-nocpp\fR
Do not filter the input file through a preprocessor
.IC \fB\-query\fR
Print the contents of all specified properties
.IC \fB\-quiet\fR
Do not display warning messages about duplicate entries
.IC \fB\-remove\fR
Remove the specified properties from the server
.IC \fB\-retain\fR
Tell the server not to reset
.IC \fB\-screen\fR
Perform the operation only on the property
.B SCREEN_RESOURCES
on the default screen
.IC \fB\-screens\fR
Perform the property
.B SCREEN_RESOURCES
for each screen
.IC \fB\-symbols\fR
Print
all symbols defined for the preprocessor
.IC "\-U\fIsymbol\fR"
Tell
.B cpp
to undefine
.I symbol
.HE
.B xrdb
manipulates the X server's resource data base.
Clients, whatever their system of origin,
read this data base to set their resources; its contents
overrides any resources set in an application's defaults file.
.\"Having this data base within the server, where it is available to all clients,
.\"instead of on disk solves the problem (seen in earlier editions of X)
.\"of having to maintain a defaults file for every application on every machine
.\"you used.
.\"It also lets you change defaults dynamically, without editing files.
This lets you change defaults dynamically, without editing defaults files.
.PP
The X server stores its resource data base in the property
.B RESOURCE_MANAGER
on the root window of screen 0 (the default screen used by the server),
or the property
.B SCREEN_RESOURCES
on the root window of any or all screens, or everything combined.
Most X clients read the properties
.B RESOURCE_MANAGER
and
.B SCREEN_RESOURCES
to get your preferences concerning color, fonts, and other properties.
.B RESOURCE_MANAGER
holds resources that apply to all screens of the display.
.B SCREEN_RESOURCES
on each screen specifies additional (or overriding)
resources to be used for that screen.
(Because X Windows for \*(CO presently supports only one screen, so
.B SCREEN_RESOURCES
is not used \(em all resources are placed into
.BR RESOURCE_MANAGER .)
.PP
.B xrdb
passes the contents of the file specified by
.I file
(or the data read from standard input if the file name `-' is used),
through the C preprocessor with the following symbols defined,
based on the capabilities of the server being used:
.IP \fBBITS_PER_RGB=\fInum\fR
The number of significant bits in an RGB color specification.
This is the log base 2 of the number of distinct shades
of each primary that the hardware can generate.
Note that it usually is not related to
.BR PLANES .
.IP \fBCLASS=\fIvisualclass\fR
Set the class of display, where
.I visualclass
is one of the following:
.BR StaticGray ,
.BR GrayScale ,
.BR StaticColor ,
.BR PseudoColor ,
.BR TrueColor ,
or
.BR DirectColor .
This is the visual class of the root window of the default screen.
.IP \fBCOLOR\fR
This is defined only if
.B CLASS
is
.BR StaticColor ,
.BR PseudoColor ,
.BR TrueColor ,
or
.BR DirectColor .
.IP \fBHEIGHT=\fInum\fR
The height of the default screen, in pixels.
.IP \fBSERVERHOST=\fIhostname\fR
The host-name portion of the display to which you are connected.
.IP \fBHOST=\fIhostname\fR
Same as
.BR SERVERHOST .
.IP \fBCLIENTHOST=\fIhostname\fR
The name of the host on which
.B xrdb
is running.
.IP \fBPLANES=\fInum\fR
The number of bit planes (the depth) of the root window of the default screen.
.IP \fBRELEASE=\fInum\fR
The vendor's release number for the server.
The interpretation of this number will vary depending on
.BR VENDOR .
.IP \fBREVISION=\fInum\fR
The X protocol's minor version supported by this server.
.IP \fBVERSION=\fInum\fR
The X protocol's major version supported by this server (should always be 11).
.IP \fBVENDOR=\fIvendor\fR
A string that names the vendor of the server.
.IP \fBWIDTH=\fInum\fR
The width of the default screen, in pixels.
.IP \fBX_RESOLUTION=\fInum\fR
The X resolution of the default screen, in pixels per meter.
.IP \fBY_RESOLUTION=\fInum\fR
The X resolution of the default screen, in pixels per meter.
.PP
.B xrdb
ignores all lines that begin with an exclamation mark `!'.
You can use them as comments.
.PP
Because
.B xrdb
can read the standard input, you can use it to redefine a
property directly from a terminal or from a shell script.
.SH "Options"
.B xrdb
recognizes the following command-line options:
.IP \fB\-all\fR
Manipulate the 
screen-independent resource property (\fBRESOURCE_MANAGER\fR)
as well as the screen-specific property (\fBSCREEN_RESOURCES\fR)
on every screen of the display.
For example, when used with option
.BR \-query ,
.B xrdb
prints the contents of all properties.
For the options
.B \-load
and
.BR \-merge ,
.B xrdb
processes the input file once for each screen.
In its output,
.B xrdb
gathers all resources that occur in common,
and applies them as the screen-independent resources.
It applies the remaining resources for each per-screen property.
This the default mode of operation.
.IP "\fB\-backup \fIstring\fR"
Append
.I string
to the end of each file name used with option
.BR \-edit ,
to generate a backup file.
.IP "\fB\-cpp \fIname\fR"
Name the preprocessor to use.
.I name
should be its full path name.
Although
.B xrdb
was designed to use
.BR cpp ,
you can use any program that acts as a filter and accepts the options
.BR \-D ,
.BR \-I ,
and
.BR \-U .
.IP "\fB\-D\fIsymbol\^\fB[=\fIvalue\^\fB]\fR"
Tell
.B cpp
to define
.I symbol
and give it
.IR value .
.IP "\fB\-display \fIdisplay\fR"
Set the X server to be used.
This option also specifies the screen to use for the option \fB\-screen\fR,
and specifies the screen from which preprocessor symbols are
derived for the option \fB\-global\fR.
.IP "\fB\-edit \fIfile\fR"
Write the specified properties into
.IR file ,
replacing any values therein.
This lets you to fold any changes that you have made to your defaults
into your resource file, while preserving any comments or preprocessor lines.
.IP \fB\-help\fR
Print a brief summary of these options.
.IP \fB\-global\fR
Perform the operation only on the screen-independent property
.BR RESOURCE_MANAGER .
.IP "\fB\-I\fIdirectory\fR"
Tell
.B cpp
to search
.I directory
for header files.
.IP \fB\-load\fR
Load the input as the new values of the specified properties,
replacing its current contents.
This is the default action.
.IP \fB\-merge\fR
Merge the input into the specified properties,
rather than replacing their contents.
This option performs lexicographically sorted merge of the two inputs,
which is almost certainly not what you want
but remains for backward compatibility.
.IP \fB\-n\fR
When used with the options
.B \-load
or
.BR \-merge ,
show on the standard output all changes to the specified properties,
but do not execute them.
When used with the option
.BR \-edit ,
show but do not execute all changes to the resource file.
.IP \fB\-nocpp\fR
Do not filter
the input file through a preprocessor before loading it into properties.
.IP \fB\-query\fR
Print onto the standard output the contents of the specified properties.
Because preprocessor commands in the input resource file are part of the input
file, not part of the property, they will appear in the output that this
option triggers.
Use the option
.B \-edit
to merge the contents of properties back into the input-resource
file without damaging preprocessor commands.
.IP \fB\-quiet\fR
Do not display warning messages about duplicate entries.
.IP \fB\-remove\fR
Remove the specified properties from the server.
.IP \fB\-retain\fR
Tell the server not to reset itself if
.B xrdb
is the first client.
This is never necessary under normal conditions, because
.\".B xdm
.\"and
.B xinit
.\"always act as the first client.
always acts as the first client.
.IP \fB\-screen\fR
Perform the operation only on the property
.B SCREEN_RESOURCES
on the default screen of the display.
.IP \fB\-screens\fR
Perform the property
.B SCREEN_RESOURCES
for each screen of the display.
With the options
.B \-load
and
.BR \-merge ,
.B xrdb
processes the input file for each screen.
.IP \fB\-symbols\fR
Print onto the standard output
all symbols that are defined for the preprocessor.
.IP "\fB\-U\fIsymbol\fR"
Tell
.B cpp
to un-define
.IR symbol .
.SH Environment
.B xrdb
reads the environmental variable
.B DISPLAY
to find which display to use.
.SH "Using xrdb"
As noted above,
.B xrdb
reads the
.I file
named on its command line.
The X display manager
.BR xdm ,
which is not included with X Windows for \*(CO,
invokes
.B xrdb
automatically to read the file
.BR $HOME/.Xdefaults .
If you wish to use
.B xrdb
under
.BR xinit ,
which is the standard way of invoking X under X Windows for \*(CO,
you must invoked from within the file
.BR $HOME/.xinitrc .
For example
.DM
	xrdb -load < $HOME/.Xdefaults
.DE
.PP
loads your personal defaults file into the X server.
.PP
The tutorial
.IR "X Windows Clients" ,
which appears earlier in this manual, gives examples of how to write
a resource file for
.BR xrdb .
.SH "See Also"
.B
appres,
editres,
X utilities
.R
.SH Notes
Copyright \(co 1991, Digital Equipment Corporation and MIT.
.PP
.II "Scheifler, Bob"
.II "Karlton, Phil"
.II "Gettys, Jim"
.B xrdb
was written by
Bob Scheifler and Phil Karlton,
based on the original program written by Jim Gettys.
