TutorialInstallation: Resources




Prev | Up | Next | Back | Forward | Online Documentation Home Page
The installation program created X server resource database initialization files in directory

aahome/Ada-ASSURED3.5/resources

These files specify such things as default key bindings, colors, and fonts. These defaults only have an effect when loaded into the X server resource database. Unfortunately there are many different ways to do so—different versions of X support somewhat incompatible mechanisms; furthermore, even for the same version of X, different sites may adopt different conventions; still worse, individual users of a site may have their own approaches. The following instructions are intended to help you thread your way through this morass.

If you are using the older X release 4 (e.g., OpenWindows), you should follow the instructions in section Resources for X release 4.

Otherwise you will need to:

  1. Specify color versus black-and-white:

  2. Choose a method for specifying the resource location:
    1. XUSERFILESEARCHPATH, OR
    2. XAPPLRESDIR
      1. Set to a public directory, OR
      2. Set to a private directory, OR
    3. xrdb


Specifying Color or Mono

To get the appropriate colors, Ada-ASSURED requires the customization resource to be set either to color or mono depending on whether you have a color or monochrome monitor.

If you only intend to use black-and-white monitors, proceed with section res-loc to choose a resource location method. If you intend to use either a color or a grey-scale monitor some of the time, then the customization resource must be initialized appropriately. Enter the command

xrdb -query | grep customization
to see if customization is initialized. If you are seated at a color or grey-scale monitor and the command replies -color, or you are seated at a black-and-white monitor and the command replies -mono, assume that customization is properly initialized. X uses the value of the customization resource (in various ways) as it searches in either XAPPLRESDIR or in one of the directories listed in XUSERFILESEARCHPATH for an appropriate X resource initialization file.

Otherwise you can set this X resource by adding the lines

#ifdef COLOR
       *customization: -color
#else
       *customization: -mono
#endif
into one of the resource initialization files processed by the xrdb, e.g., .Xdefaults or .Xresources.

In order to get the change in effect, you must then enter whichever of the following two command is appropriate:

xrdb -merge ~/.Xdefaults
or
xrdb -merge ~/.Xresources


Specifying Resource Location

There are three possibilities for loading X resources.

If you are sufficiently expert to know which of these three to use, proceed with the appropriate instructions. Otherwise, enter the command

printenv XUSERFILESEARCHPATH

to ascertain whether XUSERFILESEARCHPATH is typically set at your site. If so, use XUSERFILESEARCHPATH. If not, enter the command

printenv XAPPLRESDIR

to ascertain whether XAPPLRESDIR is typically set to some public directory of application resources. If so, use XAPPLRESDIR. If not, it would appear that neither method is in common use. If you know that your version of X supports XUSERFILESEARCHPATH, use XUSERFILESEARCHPATH; otherwise use XAPPLRESDIR set to a private directory.

XUSERFILESEARCHPATH:
This environment variable specifies a search path (i.e., a string containing an ordered list of colon-separated pathnames) appended with substitutions for aspects such as an application's X class or a monitor's color capabilities. The advantage of this method is that no copying of resource initialization files is required—one has only to add a new application's resource directory to the search path. Although this is probably the method of choice, you should be aware that defining XUSERFILESEARCHPATH prevents XAPPLRESDIR from being used, and some sites prefer to continue using the XAPPLRESDIR method.

First, determine if XUSERFILESEARCHPATH is already in use by executing the command:

printenv XUSERFILESEARCHPATH
If this returns with a blank line, enter the command
setenv XUSERFILESEARCHPATH 'aahome/Ada-ASSURED3.5/resources/%N%C:\
       aahome/Ada-ASSURED3.5/resources/%N'
otherwise, enter the command
setenv XUSERFILESEARCHPATH $XUSERFILESEARCHPATH':\
       aahome/Ada-ASSURED3.5/resources/%N%C:\
       aahome/Ada-ASSURED3.5/resources/%N'

This command adds the Ada-ASSURED resource directory to the search path in a manner that uses the customization resource if possible.

XAPPLRESDIR:
This environment variable specifies a single directory in which X looks for an appropriate resource initialization file when an application is invoked. If found, this file is used to update the X server resource database. The advantage of this method over using xrdb is that the lifetime of such resource settings is limited to the duration of the application's execution. The disadvantage of this method is that the initialization files of all applications must be copied to a single directory. Typically, this is a standard directory for the site (e.g., /usr/lib/X11/app-defaults), but there is nothing to prevent an individual user from setting XAPPLRESDIR to a private directory.

XAPPLRESDIR set to a public directory
Copy or link the following files to the directory pointed to by XAPPLRESDIR:
aahome/Ada-ASSURED3.5/resources/SynthesizerGenerator
aahome/Ada-ASSURED3.5/resources/SynthesizerGenerator-color
aahome/Ada-ASSURED3.5/resources/SynthesizerGenerator-color-only
To do this, you will probably have to be a system administrator with root privileges.

XAPPLRESDIR set to a private directory
Enter the command
setenv XAPPLRESDIR aahome/Ada-ASSURED3.5/resources/
which makes the default resources automatically available to Ada-ASSURED when it is invoked by command aa.

xrdb:
This X server resource database utility routine is usually invoked on the user's .Xdefaults (or .Xresources) file when X is initialized. It can also be invoked directly by the user, or from a user's .xinitrc file. It is the method of last resort because resources for a given X application loaded this way remain in the database even when the application is not running. This can be a problem for X terminals with limited memory, or sites with many X applications. xrdb does, however, have one great advantage over the other two methods: because its input file is passed through the C-preprocessor, resource initialization files processed by xrdb are easily parameterized.

To load the resources using xrdb, enter the command

xrdb -merge aahome/Ada-ASSURED3.5/resources/aa-resources


Resources for X release 4

If you are using the older release of X, then the mechanism for specifying resources is different.

First, XUSERFILESEARCHPATH is not available in X Release 4, so you must use XAPPLRESDIR. See the above section XAPPLRESDIR for instructions on setting this method.

Second, the customization resource is not available. In order to make the color resources available, each user of a color or grey-scale monitor must load them directly each time they start the X server. This can be done using the command

xrdb -merge $XAPPLRESDIR/SynthesizerGenerator-color-only
or by including the following lines at the end of either your .Xdefaults file or your .Xresources file (if you use xdm):
#ifdef COLOR
#include ``aahome/Ada-ASSURED3.5/resources/SythesizerGenerator-color-only''
#endif
and then entering whichever of the following two command is appropriate:
xrdb -merge ~/.Xdefaults
or
xrdb -merge ~/.Xresources


Forward