Redhat Linux Admin  «Prev  Next»
Lesson 3 Customizing X applications
Objective Use the .Xdefaults file to customize the look and feel of X applications.

Customizing X Applications in Redhat

Users want a configurable GUI. They want to customize default border sizes, title-bars , and colors for their X applications. By editing a simple text file in their home directory, .Xdefaults , Linux users can customize all parts of their X windows session.
  1. Title-bar: Part of a window border that is located at the top of the window and is used to drag the window and access window modification commands such as minimize and Shade. Shade retracts the window, leaving the title-bar in its place.
  2. Xdefaults :A standard filename used to specify X resources.
Setting resources by class
Every line in the .Xdefaults file sets preferences for specific applications or entire classes of applications. A typical line found in a user's .Xdefaults file might be:
Xterm*background: black
Xterm is the class name of all X terminal applications. You refer to specific options after the asterisk (*). In the example above, *background sets the background color attribute. The colon sets the resource to the value you supply, which in this case is black
Reading from left to right, this resource sets all X terminals' backgrounds to black.
Setting resources by application
If you only wish to set resources for a particular application, simply use the application's name instead of its class.
For example, let us say you are using xterm and kterm, which both have black backgrounds because of the Xterm class resource just set. You prefer blue text in your xterm, but want to keep the default text color in kterm. To set xterm's foreground, but leave kterm's alone, you only add this resource line:

xterm*foreground: blue

The MouseOver below shows examples of other resources you may want to set in the command line format. Check the X man page for a complete list of resources. prev prev next next

Using xdefault file
The next lesson shows you how to use the GNOME Display Manager to manage X sessions.