1XINIT(1)                    General Commands Manual                   XINIT(1)
2
3
4

NAME

6       xinit - X Window System initializer
7

SYNOPSIS

9       xinit  [  [  client ] options ... ] [ -- [ server ] [ display ] options
10       ... ]
11

DESCRIPTION

13       The xinit program is used to start the X Window  System  server  and  a
14       first  client  program  on  systems  that  cannot start X directly from
15       /etc/init or in environments that use multiple  window  systems.   When
16       this  first  client exits, xinit will kill the X server and then termi‐
17       nate.
18
19       If no specific client program is given on the command line, xinit  will
20       look  for a file in the user's home directory called .xinitrc to run as
21       a shell script to start up client programs.  If no  such  file  exists,
22       xinit will use the following as a default:
23
24            xterm  -geometry  +1+1  -n  login  -display  :0
25
26
27       If  no specific server program is given on the command line, xinit will
28       look for a file in the user's home directory called .xserverrc  to  run
29       as  a  shell  script  to  start up the server.  If no such file exists,
30       xinit will use the following as a default:
31
32            X  :0
33
34       Note that this assumes that there is a program named X in  the  current
35       search  path.   However,  servers  are usually named Xdisplaytype where
36       displaytype is the type of graphics display which  is  driven  by  this
37       server.   The  site administrator should, therefore, make a link to the
38       appropriate type of server on the machine, or  create  a  shell  script
39       that runs xinit with the appropriate server.
40
41       Note,  when  using  a  .xserverrc script be sure to ``exec'' the real X
42       server.  Failing to do this can make the X server  slow  to  start  and
43       exit.  For example:
44
45            exec Xdisplaytype
46
47       An important point is that programs which are run by .xinitrc should be
48       run in the background if they do not exit  right  away,  so  that  they
49       don't prevent other programs from starting up.  However, the last long-
50       lived program started (usually a window manager or  terminal  emulator)
51       should  be  left in the foreground so that the script won't exit (which
52       indicates that the user is done and that xinit should exit).
53
54       An alternate client and/or server may be specified on the command line.
55       The  desired  client  program  and its arguments should be given as the
56       first command line arguments to xinit.  To specify a particular  server
57       command  line,  append  a  double  dash  (--) to the xinit command line
58       (after any client and arguments) followed by the  desired  server  com‐
59       mand.
60
61       Both  the  client  program  name and the server program name must begin
62       with a slash (/) or a period (.).  Otherwise, they are  treated  as  an
63       arguments to be appended to their respective startup lines.  This makes
64       it possible to add arguments (for example,  foreground  and  background
65       colors) without having to retype the whole command line.
66
67       If  an explicit server name is not given and the first argument follow‐
68       ing the double dash (--) is a colon followed by a digit, xinit will use
69       that number as the display number instead of zero.  All remaining argu‐
70       ments are appended to the server command line.
71

EXAMPLES

73       Below are several examples of how command line arguments in  xinit  are
74       used.
75
76       xinit   This  will  start up a server named X and run the user's .xini‐
77               trc, if it exists, or else start an xterm.
78
79       xinit -- /usr/local/bin/Xqdss  :1
80               This is how one could start a specific type  of  server  on  an
81               alternate display.
82
83       xinit -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy
84               This  will start up a server named X, and will append the given
85               arguments to the default xterm command.  It will ignore  .xini‐
86               trc.
87
88       xinit -e widgets -- ./Xsun -l -c
89               This  will  use the command .Xsun -l -c to start the server and
90               will append the arguments -e widgets to the default xterm  com‐
91               mand.
92
93       xinit /usr/ucb/rsh fasthost cpupig -display ws:1 --  :1 -a 2 -t 5
94               This  will  start  a server named X on display 1 with the argu‐
95               ments -a 2 -t 5.  It will then start  a  remote  shell  on  the
96               machine  fasthost  in  which  it  will  run the command cpupig,
97               telling it to display back on the local workstation.
98
99       Below is a sample .xinitrc that starts a clock, several terminals,  and
100       leaves  the window manager running as the ``last'' application.  Assum‐
101       ing that the window manager has been configured properly, the user then
102       chooses the ``Exit'' menu item to shut down X.
103
104               xrdb -load $HOME/.Xresources
105               xsetroot -solid gray &
106               xclock -g 50x50-0+0 -bw 0 &
107               xload -g 50x50-50+0 -bw 0 &
108               xterm -g 80x24+0+0 &
109               xterm -g 80x24+0-0 &
110               twm
111
112       Sites  that  want  to  create a common startup environment could simply
113       create a default .xinitrc that references a site-wide startup file:
114
115               #!/bin/sh
116               . /usr/local/lib/site.xinitrc
117
118       Another approach is to write a script that starts xinit with a specific
119       shell  script.   Such  scripts are usually named x11, xstart, or startx
120       and are a convenient way to  provide  a  simple  interface  for  novice
121       users:
122
123               #!/bin/sh
124               xinit /usr/local/lib/site.xinitrc -- /usr/bin/X -br
125
126

ENVIRONMENT VARIABLES

128       DISPLAY        This  variable  gets  set  to the name of the display to
129                      which clients should connect.
130
131       XINITRC        This variable specifies an init  file  containing  shell
132                      commands  to  start up the initial windows.  By default,
133                      .xinitrc in the home directory will be used.
134

FILES

136       .xinitrc       default client script
137
138       xterm          client to run if .xinitrc does not exist
139
140       .xserverrc     default server script
141
142       X              server to run if .xserverrc does not exist
143

SEE ALSO

145       X(7), startx(1), Xserver(1), xterm(1)
146

AUTHOR

148       Bob Scheifler, MIT Laboratory for Computer Science
149
150
151
152X Version 11                      xinit 1.0.9                         XINIT(1)
Impressum