Changing colors

Example 2: Customizing colors with resources

For this example, let's assume that you use the scomail program frequently and want to quickly distinguish its window from other windows on your screen. A good way to do this is to change the colors that are used by the scomail window without changing the colors that all other windows use.

This example covers how an individual user can make this kind of color change without changing colors in the current palette. It is not recommended that a system administrator change colors on a system-wide level in this fashion, because possible colormap conflicts may arise for users.

The following steps result in a scomail client that displays colors that are unique from those used by the rest of the Graphical Environment.

  1. Log into the system. If you did not log in through a scologin window, start a Graphical Environment session by entering:

    startx &

  2. Launch a scoterm window by double-clicking on the UNIX icon.

  3. In your home directory, create a file called .Xdefaults-hostname, where hostname is the name of your system. This example uses scooter as your host name.

  4. Edit your .Xdefaults-scooter file and add the following resource specifications:

    ScoMail*background: blue
    ScoMail*activeBackground: yellow

    These resource specifications tell the X server that the background of the scomail window should be blue and the background of the window frame should be yellow when the scomail window is active. With these color settings, your scomail window will always be easy to distinguish.

  5. When you finish entering the color resource specifications, save and exit the .Xdefaults-scooter file.

  6. To verify that the X server recognizes your color specifications, run the scomail client. You should see a window with a blue background and a yellow active border.

Previous topic: Example 1: Using custom colors in default palettes

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