[Contents] [Index] [Next] [Previous]

Setting Resources on the Command Line


The X Window System provides numerous command-line options that you can use when you are starting most client applications:

Option Abbreviation Description
-background -bg Color of the window's background
-bordercolor -bd Color of the window's border
-borderwidth -bw Width of the border in pixels
-display -d Display on which the client can run
-foreground -fg Color of the text or drawings
-geometry -g Size and placement
-iconic -i Start application as an icon
-name -n Name of the application
-reverse -rv, +rv Reverse foreground and background colors
-title -t Text displayed in the title bar
-xrm None Next argument contains any resource specification

These options usually correspond to specific resources. If you want to start a new terminal window with a color that is not the background color specified in the configuration file, start the client using the -bg option; all other resources will take the default values. For example:

xterm -bg Red &

Any valid resource specification can follow the -xrm option in '' (single quotes). For example:

xclock -xrm 'xclock*background: Red' &

Resources specified in this manner are only applicable to the current instance of the program.

Be sure that the resource specification is specific enough to have the desired effect. A resource specification in a configuration file takes precedence over a command-line option if the command line is less explicit. For example, if the resource file includes this specification:

xclock*hands: Blue

the following command line will have no effect:

xclock -xrm `*hands: Red' &

Therefore, you would have to enter the following command line:

xclock -xrm 'xclock*hands: Red' &

Not all Motif applications support all of these command-line options. To see which options are actually available for a particular application, refer to the documentation for the application.