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 are not using a display manager
15       such as xdm(1) or in environments that  use  multiple  window  systems.
16       When  this  first  client  exits, xinit will kill the X server and then
17       terminate.
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.  The site administrator should, therefore, make a link to
36       the appropriate type of server on the machine, or create a shell script
37       that runs xinit with the appropriate server.
38
39       Note,  when  using  a  .xserverrc script be sure to ``exec'' the real X
40       server.  Failing to do this can make the X server  slow  to  start  and
41       exit.  For example:
42
43            exec Xdisplaytype
44
45       An important point is that programs which are run by .xinitrc should be
46       run in the background if they do not exit  right  away,  so  that  they
47       don't prevent other programs from starting up.  However, the last long-
48       lived program started (usually a window manager or  terminal  emulator)
49       should  be  left in the foreground so that the script won't exit (which
50       indicates that the user is done and that xinit should exit).
51
52       An alternate client and/or server may be specified on the command line.
53       The  desired  client  program  and its arguments should be given as the
54       first command line arguments to xinit.  To specify a particular  server
55       command  line,  append  a  double  dash  (--) to the xinit command line
56       (after any client and arguments) followed by the  desired  server  com‐
57       mand.
58
59       Both  the  client  program  name and the server program name must begin
60       with a slash (/) or a period (.).  Otherwise, they are  treated  as  an
61       arguments to be appended to their respective startup lines.  This makes
62       it possible to add arguments (for example,  foreground  and  background
63       colors) without having to retype the whole command line.
64
65       If  an explicit server name is not given and the first argument follow‐
66       ing the double dash (--) is a colon followed by a digit, xinit will use
67       that number as the display number instead of zero.  All remaining argu‐
68       ments are appended to the server command line.
69

EXAMPLES

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

ENVIRONMENT VARIABLES

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

FILES

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

SEE ALSO

143       X(7), startx(1), Xserver(1), Xorg(1), xorg.conf(5), xterm(1)
144

AUTHOR

146       Bob Scheifler, MIT Laboratory for Computer Science
147
148
149
150X Version 11                      xinit 1.4.0                         XINIT(1)
Impressum