1XINIT(1) General Commands Manual XINIT(1)
2
3
4
6 xinit - X Window System initializer
7
9 xinit [ [ client ] options ... ] [ -- [ server ] [ display ] options
10 ... ]
11
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 (af‐
56 ter any client and arguments) followed by the desired server command.
57
58 Both the client program name and the server program name must begin
59 with a slash (/) or a period (.). Otherwise, they are treated as an
60 arguments to be appended to their respective startup lines. This makes
61 it possible to add arguments (for example, foreground and background
62 colors) without having to retype the whole command line.
63
64 If an explicit server name is not given and the first argument follow‐
65 ing the double dash (--) is a colon followed by a digit, xinit will use
66 that number as the display number instead of zero. All remaining argu‐
67 ments are appended to the server command line.
68
70 Below are several examples of how command line arguments in xinit are
71 used.
72
73 xinit This will start up a server named X and run the user's .xini‐
74 trc, if it exists, or else start an xterm.
75
76 xinit -- /usr/bin/Xvnc :1
77 This is how one could start a specific type of server on an al‐
78 ternate display.
79
80 xinit -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy
81 This will start up a server named X, and will append the given
82 arguments to the default xterm command. It will ignore .xini‐
83 trc.
84
85 xinit -e widgets -- ./Xorg -l -c
86 This will use the command ./Xorg -l -c to start the server and
87 will append the arguments -e widgets to the default xterm com‐
88 mand.
89
90 xinit /usr/bin/ssh -X fasthost cpupig -- :1 -a 2 -t 5
91 This will start a server named X on display 1 with the argu‐
92 ments -a 2 -t 5. It will then start a remote shell on the ma‐
93 chine fasthost in which it will run the command cpupig, telling
94 it to display back on the local workstation.
95
96 Below is a sample .xinitrc that starts a clock, several terminals, and
97 leaves the window manager running as the ``last'' application. Assum‐
98 ing that the window manager has been configured properly, the user then
99 chooses the ``Exit'' menu item to shut down X.
100
101 xrdb -load $HOME/.Xresources
102 xsetroot -solid gray &
103 xclock -g 50x50-0+0 -bw 0 &
104 xload -g 50x50-50+0 -bw 0 &
105 xterm -g 80x24+0+0 &
106 xterm -g 80x24+0-0 &
107 twm
108
109 Sites that want to create a common startup environment could simply
110 create a default .xinitrc that references a site-wide startup file:
111
112 #!/bin/sh
113 . /etc/X11/xinit/site.xinitrc
114
115 Another approach is to write a script that starts xinit with a specific
116 shell script. Such scripts are usually named x11, xstart, or startx
117 and are a convenient way to provide a simple interface for novice
118 users:
119
120 #!/bin/sh
121 xinit /etc/X11/xinit/site.xinitrc -- /usr/bin/X -br
122
123
125 DISPLAY This variable gets set to the name of the display to
126 which clients should connect.
127
128 XINITRC This variable specifies an init file containing shell
129 commands to start up the initial windows. By default,
130 .xinitrc in the home directory will be used.
131
133 .xinitrc default client script
134
135 xterm client to run if .xinitrc does not exist
136
137 .xserverrc default server script
138
139 X server to run if .xserverrc does not exist
140
142 X(7), startx(1), Xserver(1), Xorg(1), xorg.conf(5), xterm(1)
143
145 Bob Scheifler, MIT Laboratory for Computer Science
146
147
148
149X Version 11 xinit 1.4.2 XINIT(1)