initial commit
[profile/ivi/xorg-x11-xinit.git] / xinit.man
1 .\" $Xorg: xinit.man,v 1.4 2001/02/09 02:05:49 xorgcvs Exp $
2 .\" Copyright 1988, 1998  The Open Group
3 .\" 
4 .\" Permission to use, copy, modify, distribute, and sell this software and its
5 .\" documentation for any purpose is hereby granted without fee, provided that
6 .\" the above copyright notice appear in all copies and that both that
7 .\" copyright notice and this permission notice appear in supporting
8 .\" documentation.
9 .\" 
10 .\" The above copyright notice and this permission notice shall be included
11 .\" in all copies or substantial portions of the Software.
12 .\" 
13 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 .\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17 .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19 .\" OTHER DEALINGS IN THE SOFTWARE.
20 .\" 
21 .\" Except as contained in this notice, the name of The Open Group shall
22 .\" not be used in advertising or otherwise to promote the sale, use or
23 .\" other dealings in this Software without prior written authorization
24 .\" from The Open Group.
25 .\" 
26 .\" $XFree86: xc/programs/xinit/xinit.man,v 3.9 2001/02/07 23:25:56 dawes Exp $
27 .\" 
28 .TH XINIT 1 __xorgversion__
29 .SH NAME
30 xinit \- X Window System initializer
31 .SH SYNOPSIS
32 .B xinit
33 [ [
34 .I client
35 ]
36 .I options
37 \&\.\|.\|. ] [
38 .B \-\^\-
39 [
40 .I server
41 ] [
42 .I display
43 ]
44 .I options
45 \&.\|.\|. ]
46 .SH DESCRIPTION
47 The \fIxinit\fP program is used to start the X Window System server and a first
48 client program on systems that
49 cannot start X directly from \fI/etc/init\fP or in environments
50 that use multiple window systems.  When this first client exits, 
51 \fIxinit\fP will kill the X server and then terminate.
52 .PP
53 If no specific client program is given on the command line,
54 \fIxinit\fP will look for a file in the user's home directory
55 called \fI.xinitrc\fP to run as a shell script to start up client programs.
56 If no such file exists, \fIxinit\fP will use the following as a default:
57 .sp
58         xterm  \-geometry  +1+1  \-n  login  \-display  :0
59 .sp
60 .PP
61 If no specific server program is given on the command line,
62 \fIxinit\fP will look for a file in the user's home directory
63 called \fI.xserverrc\fP to run as a shell script to start up the server.
64 If no such file exists, \fIxinit\fP will use the following as a default:
65 .sp
66         X  :0
67 .sp
68 Note that this assumes that there is a program named \fIX\fP in the current
69 search path.  However, servers are usually named \fIXdisplaytype\fP where 
70 \fIdisplaytype\fP is the type of graphics display which is driven by this
71 server.  The site administrator should, therefore, make a link to the 
72 appropriate type of server on the machine, or create a shell script that
73 runs \fIxinit\fP with the appropriate server.
74 .PP
75 Note, when using a \fI.xserverrc\fP script be sure to ``exec'' the real X server.
76 Failing to do this can make the X server slow to start and exit.  For example:
77 .sp
78         exec Xdisplaytype
79 .PP
80 An important point is that programs which are run by \fI\.xinitrc\fP
81 should be run in the background if they do 
82 not exit right away, so that they don't prevent other programs from
83 starting up.
84 However, the last long-lived program started (usually
85 a window manager or terminal emulator) should be
86 left in the foreground so that the script won't exit (which
87 indicates that the user is done and that \fIxinit\fP should exit).
88 .PP
89 An alternate client and/or server may be specified on the
90 command line.  The desired client program and its arguments should be given
91 as the first command line arguments to \fIxinit\fP.  To specify a particular
92 server command line, append a double dash (\-\^\-) to the \fIxinit\fP command
93 line (after any client and arguments) followed by the desired server command.
94 .PP
95 Both the client program name and the server program name must begin with a
96 slash (/) or a period (.).  Otherwise, they are treated as an arguments to be
97 appended to their respective startup lines.  This makes it possible to 
98 add arguments (for example, foreground and background colors) without 
99 having to retype the whole command line.
100 .PP
101 If an explicit server name is not given and the first argument following the
102 double dash (\-\^\-) is a colon followed by a digit, \fIxinit\fP will use that 
103 number as the display 
104 number instead of zero.  All remaining arguments are appended to the server 
105 command line.
106 .PP
107 .SH EXAMPLES
108 Below are several examples of how command line arguments in \fIxinit\fP are
109 used.
110 .TP 8
111 .B "xinit"
112 This will start up a server named \fIX\fP and run the user's \fI\.xinitrc\fP,
113 if it exists, or else start an \fIxterm\fP.
114 .TP 8
115 .B "xinit \-\^\- /usr/local/bin/Xqdss  :1"
116 This is how one could start a specific type of server on an alternate display.
117 .TP 8
118 .B "xinit \-geometry =80x65+10+10 \-fn 8x13 \-j \-fg white \-bg navy"
119 This will start up a server named \fIX\fP, and will append the given
120 arguments to the default \fIxterm\fP command.  It will ignore \fI\.xinitrc\fP.
121 .TP 8
122 .B "xinit \-e widgets \-\^\- ./Xsun \-l \-c"
123 This will use the command \fI\.\/Xsun \-l \-c\fP to start the server and will
124 append the arguments \fI\-e widgets\fP to the default \fIxterm\fP command.
125 .TP 8
126 .B "xinit /usr/ucb/rsh fasthost cpupig \-display ws:1 \-\^\-  :1 \-a 2 \-t 5"
127 This will start a server named \fIX\fP on display 1 with the arguments
128 \fI\-a 2 \-t 5\fP.  It will then start a remote shell on the machine
129 \fBfasthost\fP in which it will run the command \fIcpupig\fP, telling it
130 to display back on the local workstation.
131 .PP
132 Below is a sample \fI\.xinitrc\fP that starts a clock, several terminals, and
133 leaves the window manager running as the ``last'' application.  Assuming that
134 the window manager has been configured properly, the user
135 then chooses the ``Exit'' menu item to shut down X.
136 .sp
137 .in +8
138 .nf
139 xrdb \-load $HOME/.Xresources
140 xsetroot \-solid gray &
141 xclock \-g 50x50\-0+0 \-bw 0 &
142 xload \-g 50x50\-50+0 \-bw 0 &
143 xterm \-g 80x24+0+0 &
144 xterm \-g 80x24+0\-0 &
145 twm
146 .fi
147 .in -8
148 .sp
149 Sites that want to create a common startup environment could simply create
150 a default \fI\.xinitrc\fP that references a site-wide startup file:
151 .sp
152 .in +8
153 .nf
154 \&#!/bin/sh
155 \&. /usr/local/lib/site.xinitrc
156 .fi
157 .in -8
158 .sp
159 Another approach is to write a script that starts \fIxinit\fP with a specific
160 shell script.  Such scripts are usually named \fIx11\fP, \fIxstart\fP, or
161 \fIstartx\fP and are a convenient way to provide a simple interface for
162 novice users:
163 .sp
164 .in +8
165 .nf
166 \&#!/bin/sh
167 xinit /usr/local/lib/site.xinitrc \-\^\- __bindir__/X -br
168 .fi
169 .in -8
170 .sp
171 .SH "ENVIRONMENT VARIABLES"
172 .TP 15
173 .B DISPLAY
174 This variable gets set to the name of the display to which clients should
175 connect.
176 .TP 15
177 .B XINITRC
178 This variable specifies an init file containing shell commands to start up the
179 initial windows.  By default, \fI\.xinitrc\fP in the home directory will be 
180 used.
181 .SH FILES
182 .TP 15
183 .I .xinitrc
184 default client script
185 .TP 15
186 .I xterm
187 client to run if \fI.xinitrc\fP does not exist
188 .TP 15
189 .I .xserverrc
190 default server script
191 .TP 15
192 .I X
193 server to run if \fI.xserverrc\fP does not exist
194 .SH "SEE ALSO"
195 .IR X (__miscmansuffix__),
196 .IR startx (1),
197 .IR Xserver (1),
198 .IR xterm (1)
199 .SH AUTHOR
200 Bob Scheifler, MIT Laboratory for Computer Science