Understanding resources

Resource specifications on the command line

The -xrm option allows you to define on the command line, any resource specification that you would otherwise put into a resource file. For example:

scoterm -xrm 'ScoTerm*scrollBar: true' &

Note that the resource specification must be quoted using single quotes, as in the above example.

Any resources that you specify with the -xrm option are implemented for the current client session only. As a result, using this approach is a good way to temporarily change the appearance or behavior of a client without overwriting the default settings.

NOTE: If you are using scosession and you exit the Graphical Environment with a client that was run from the command line still open on your display, the client is restored when you resume your session. Any resources specified with the -xrm option when the client was started are also restored. In this way, the -xrm option can define client behavior on a more permanent basis

The -xrm option is most useful for setting classes, since most clients have command line options that correspond to instance variable names. For example, the -fg command line option sets the foreground attribute of a window, but -xrm must be used to set Foreground.

A resource that is specified with the -xrm option does not take effect if a resource that has precedence has already been loaded into the resource database. For example, if the resource database contains the following resource specification:

   ScoTerm*pointerShape: bogosity
the following command line specification of another cursor for scoterm will fail:

scoterm -xrm '*pointerShape: gumby' &

This failure results because the resource ScoTerm*pointerShape is more specific than the resource *pointerShape. To override the resource database so you can use the ``Gumby'' cursor, you need to use a resource specification that is equally or more specific than the designation in the database. For example:

scoterm -xrm 'ScoTerm*pointerShape: gumby' &

Next topic: Guidelines for managing resources
Previous topic: Window title option

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003