.TH startx "" "" "X Utility"
.PC "Initiate an X session"
\fB/usr/X11/bin/startx [ [ \fIclient \fB] \fIoptions ... \fB] [\-\^\- [ \fIserver \fB] \fIoptions ... \^\fB]\fR
.PP
The script
.B startx
is a front end to the application
.BR xinit .
It provides a somewhat easier interface for running a session
of the X Window System.
It typically is run with no arguments.
.PP
To determine which client to run,
.B startx
first looks for a file called
.BR $HOME/.xinitrc .
.II xinitrc
If it cannot find that file, it uses the file
.BR /usr/X11/lib/xinit/xinitrc .
If command-line client options are given, they override this behavior.
.\".PP
.\"To determine the server to run,
.\".B startx
.\"first looks for a file called
.\".BR $HOME/.xserverrc .
.\"If it does not find that file,
.\".B startx
.\"uses file
.\".B xserverrc
.\"in the directory of the
.\".B xinit
.\"library.
.\"If command-line server options are given,
.\"they override this behavior.
.\"A user rarely needs to provide his own copy of
.\".BR .xserverrc .
.\"For details on the arguments, see the Lexicon entry for
.\".BR xinit .
.PP
.B $HOME/.xinitrc
typically is a shell script that starts many clients according to the
user's preference.
When this shell script exits,
.B startx
kills the server and performs any other tasks needed to shut down a session.
Most of the clients that
.B $HOME/.xinitrc
starts should be run in the background.
The last client should run in the foreground; when it exits,
the session exits.
People often choose a session manager, window manager, or
.B xterm
as the ``magic'' client.
.SH Example
Below is a sample
.B $HOME/.xinitrc
that starts several applications and leaves the window manager
running as the ``last'' application.
Assuming that the window manager has been configured properly,
the user then chooses the
.B Exit
menu item to shut down X.
.DM
	xrdb  \-load  $HOME/.Xresources
	xsetroot  \-solid  gray  &
	xbiff  \-geometry  \-430+5  &
	oclock  \-geometry  75x75\-0\-0  &
	xterm  \-geometry  +0+60  \-ls  &
	xterm  \-geometry  +0\-100  &
	xconsole  \-geometry  \-0+0  \-fn  5x7  &
	twm
.DE
.SH "Environment"
.B startx
sets the environmental variable \fBDISPLAY\fR,
which names the display to which clients should connect.
.SH Files
\fB$(HOME)/.xinitrc\fR \(em Clients to run
.br
\fB$(HOME)/.xserverrc\fR \(em Server to run; the default is \fBX\fR
.br
\fB/usr/X11/lib/xinit/xinitrc\fR \(em Name default clients
.br
\fB/usr/X11/lib/xinit/xserverrc\fR \(em Name default server
.SH "See Also"
.B
xinit,
X utilities
.R
.\".SH Notes
.\"The version of
.\".B startx
.\"that comes with this release is a sample that is
.\"designed more as a base for customization than as a finished product.
.\"You should customize it for your site.
