[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 User's Guide



Using Command-Line Options

Many X applications provide the same basic set of options, as listed in Table 4-1. Often, you can just supply simple arguments to these options to have them set the resources properly. Other times, you need to define fuller resource specifications to get the values to override the existing resource settings. This section provides some examples of how to use command-line options to set resource values.

The simplest use of a command-line option is to pass it a single argument, as follows. 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 by using the --bg option; all other resources will take the default values. For example:

+--------------------------------------------------------------------------------+
|% xterm -bg Red &                                                               |
+--------------------------------------------------------------------------------+

In the case of valid resources that do not have associated command-line options, you can use the --xrm option to set the values. Any valid resource specification can follow the --xrm option in '' (single quotes). For example:

+--------------------------------------------------------------------------------+
|% xclock -xrm '*hands: Red' &                                                   |
+--------------------------------------------------------------------------------+

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

In the preceding examples, a more specific resource specification was unnecessary to achieve the desired effect. However, a resource specification in a configuration file can take 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' &                                                   |
+--------------------------------------------------------------------------------+

To override the specification in the resource file, you would have to enter the following command line:

+--------------------------------------------------------------------------------+
|% xclock -xrm 'xclock*hands: Red' &                                             |
+--------------------------------------------------------------------------------+

Note that 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.


[ Previous | Next | Contents | Glossary | Home | Search ]