DistributedNetworks DistributedNetworks

X Display Server  «Prev 

Configuring an X startup with .xinitrc

How do you configure an X startup with .xinitrc?

file is a shell script read by xinit and by its front-end startx. It is mainly used to execute desktop environments, window managers and other programs when starting the X server (i.e., starting daemons and setting environment variables). The xinit program starts the X Window System server and works as first client program on systems that are not using a display manager.
One of the main functions of ~/.xinitrc is to dictate which client for the X Window System is invoked with startx or xinit programs on a per-user basis. There exists numerous additional specifications and commands that may also be added to ~/.xinitrc as you further customize your system.

Red Hat Reference
The line executes the xrdb command with the load option. It loads the X resources database file located in the user's directory.

xsetroot sets the color of the root window (or background) to solid gray.

These commands bring up a clock and a CPU load indicator. The -g option signifies that a geometry specification follows.

The first pair of numbers, separated by an x give the size of the window in pixels in the form width X height. The second pair of numbers indicates window positioning, the first of these is the horizontal position, and the second is the vertical position.
A number preceded by a (+) indicates position relative to the top or left hand side of the screen, whereas a (-) indicates that the following number is relative to the bottom of right hand side of the screen

There are two lines of code that indicate initial xterms will start. The last line starts the window manager. The exec command tells xinit to start the window manager and have the X clients be child processes of it.
If just the window manager executable is supplied, it will be a child of a shell spawned by X. The X clients would then also be child processes of this shell.