Changing colors

The -xrm option

The -xrm option allows you to set any resource value, including color specifications, from the command line. You must enter the resource specification as well as the desired color when using this option. You can specify a color by using either its database name or its hexadecimal RGB values. (See ``The RGB and HSV color models'' for information on how to set resources with hexadecimal RGB values.)

For example, to change the color of the active window frame for scoterm, enter the following at the command line:

scoterm -xrm 'ScoTerm*activeBackground: red' &

When using the -xrm option, you should follow these rules:

A color resource specified at the command line with the -xrm option will not take effect if X has already recognized a color resource, either in the resource database or in an .Xdefaults-hostname file, that takes precedence. (See ``Precedence rules for resource specifications'' for information on the precedence of resource specifications.) For example, you might create an .Xdefaults-hostname file with the following resource specification:
   ScoTerm*mainMenu*background: green
In this case, the following command line specification would not cause the scoterm client to display an aquamarine-colored main menu:

scoterm -xrm 'ScoTerm*background: aquamarine' &

Because the ScoTerm*mainMenu*background designation is more specific, the ScoTerm*background entry on the command line cannot change the background color of scoterm's main menu.

To override the resource database and get the new menu background color, you would need to use a resource equal to or more specific than the default setting. For example, the resource ScoTerm*mainMenu*background would provide the desired color change.

Next topic: The -bg and -fg options
Previous topic: Setting colors from the command line

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