DistributedNetworks DistributedNetworks


X Display Server  «Prev  Next»
Lesson 7Configuring an X startup with .xinitrc
Objectiveconfigure X startup with .xinitrc

Configuring an X startup with .xinitrc

How do you configure X startup with .xinitrc?
The default X configuration is not customized at all.
To make good use of the GUI, you may want certain programs to start as soon as you log in. You might want to open an xterm or two, an email window, a file browser, or a system resources monitor. The .xinitrc file can be used to control this startup behavior.

Starting applications

When the X server starts, it loads the applications you specify from .xinitrc, which resides in your home directory. You may start any application you want by listing its full path followed by an ampersand (&) on each line of .xinitrc. For example, to start the xclock application, you simply need a line in your .xinitrc file such as /usr/X11R6/bin xclock &.

Window manager

Of all the applications you start, the last one must be your window manager, which allows you to make your environment user friendly. Any programs listed after the window manager will not run. The window manager must be the last line in .xinitrc.
Unlike the other programs listed in your .xinitrc file, do not include the ampersand after the window manager; if you do, your X session will not run.

The SlideShow below explores a simple .xinitrc file.
Pay special attention to the seemingly peculiar string that follows the -g on lines 3 through 6.



Configuring xstartup xinitrc
More information about .xinitrc can be found in the xinit man page. The next lesson concludes this module.