Translation(s): English - Fran├žais - Italiano

The xinit program is used to start the X Window System server and a first client program on systems that cannot start X directly from /etc/init or in environments that use multiple window systems. When this first client exits, xinit will kill the X server and then terminate.

If no specific client program is given on the command line, xinit will look for a hidden file in the user's home_directory called .xinitrc to run as a shell script to start up client programs

A .xinitrc sample is:

# ~/.xinitrc
# This file is sourced when running startx and 
#    other programs which call xinit
# As in all Bash/sh scripts lines starting with 
#    '#' are comments

# Set background to your favorite pic
xsetbg -fullscreen /morphix/background.png &

# Start a XTerm
/usr/bin/X11/xterm &

# Start the systems window manager.
# See WindowManagers for other choices.
exec /etc/alternatives/x-window-manager

# To run Gnome instead of system default, place a 
# '#' before the previous line and uncomment the 
# next line.
# exec gnome-session

Note that ~/.xinitrc is only for configuring the initialization of xinit. If you want the script to be called when ever an X Session is started, then you should instead use ~/.xsession. Most WindowManagers also have a method of starting programs when they first startup.