Graphical Environment  «Prev 

Using .Xdefault File

Question: What is the function of the .Xdefault file in the X Windows System of Red Hat Linux?
The .Xdefaults file plays an integral role in the X Window System of Red Hat Linux by providing a mechanism for the user to customize the appearance and behavior of X applications. This file, typically located in a user's home directory, contains a series of resource specifications which are essentially key-value pairs that alter various aspects of an X application.
The X Window System is designed to be highly customizable, and the .Xdefaults file is a primary means of achieving this customization. Each line in the file represents one resource setting. It is generally formatted with the name of the application, the resource name, and the value that the resource should be set to.
For example:
XTerm*background: black
XTerm*foreground: white

These two lines specify that the XTerm application should have a black background and white text. The .Xdefaults file is read once when an X session begins. It is worth noting that the settings defined in .Xdefaults are applied on a per-user basis, providing each user with the ability to customize their X applications as they see fit.
If changes are made to the .Xdefaults file, they are not automatically picked up by the running X session. To update the settings, one would typically use the xrdb command to load the new resource definitions:
xrdb -merge ~/.Xdefaults

However, it's worth noting that .Xdefaults has largely been superseded by the .Xresources file. While they serve similar purposes, .Xresources is considered superior because it supports a wider range of operations, such as conditional processing, and it is typically read by the xrdb program when the X server starts, which can be more efficient in networked environments. Regardless, the use of .Xdefaults or .Xresources depends largely on the specific practices of the distribution, desktop environment, or individual user.

Xresources is user-level Configuration Dotfile

Xresources is a user-level configuration dotfile, typically located at ~/.Xresources.
It can be used to set X resources, which are configuration parameters for X client applications. They can do many operations, including:
  1. defining terminal colours
  2. configuring terminal preferences
  3. setting DPI, antialiasing, hinting and other X font settings
  4. changing the Xcursor theme
  5. theming xscreensaver
  6. altering preferences on low-level X applications (xclock (xorg-xclock), xpdfAUR, rxvt-unicode, etc.)
A number of excellent Xterm alternatives are
  1. XFCE terminal,
  2. gnome-terminal, and
  3. Konsole.

Default file

  1. The geometry resource in this line tells all applications of class Xcalc to originate the lower right-hand portion of the screen.
  2. The cursorColor resource changes the cursor's color in all Xterm class terminal windows to blue.
  3. xload is an application that shows system load overtime in an easy-to-read bar graph.
    These two command lines set the graph to red on white for all applications in the Xload class.
  4. By setting the border to 0, the border around xload will disappear, which decreases its footprint on the root window. Applications that are members of Xload, other than xload itself, will still have a visible border.