Next | Prev | Up | Top | Contents | Index

X Defaults

The usual X defaults mechanism is used to provide defaults to resources. Default values are located in files designated by the XAPPDEFAULTS environment variable, including an optional locale directory (designated by the LANG environment). XAPPDEFAULTS defaults to /usr/lib/X11/app-defaults, and LANG is usually not defined. In this simplest case, the located file would be /usr/lib/X11/app-defaults/ApplicationName, where ApplicationName is the class name of your application.

These defaults could be reset by the xrdb command; see the xrdb(1) reference page for details. Usually, login scripts read a user-customized resource file, often named .Xdefaults or .Xresources, using the xrdb -merge command. This is the usual way for users to configure their environment.

Finally, some applications employ special configuration files, which might also reset additional resources. The Motif window manager mwm is a good example of this complex area, as it looks in not fewer than eight different resource files; see mwm(1) for more information.

Resource files contain lines specifying values for widget or widget class resources. The syntax is shown below:

resourcePath : value

Here, resourcePath is a dot-separated path naming a particular resource in the hierarchy, while value is a string representation for the resource setting.

Resource paths start with an optional application name. Without this, the settings apply to all X applications. After that, names in the path may refer to a widget class (when starting with a capital), to widget names (as defined by moat creation command), or to application-specific scoping. The star character (*) may be used to match any portion of the resource path. Table 4-6 shows some examples of resource paths.

Examples of Resource Names
Resource PathWhat it Affects
*Backgroundfor all widgets, in all sessions
*PushButton.Backgroundfor all the push button instances
xterm*Backgroundfor all widgets of the xterm application
jot.fileMenu.quit.Backgroundfor the Quit button in the File menu of jot


Next | Prev | Up | Top | Contents | Index