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
12 The xinit program is used to start the X Window System server and a
13 first client program on systems that cannot start X directly from
14 /etc/init or in environments that use multiple window systems. When
15 this first client exits, xinit will kill the X server and then termi‐
16 nate.
17
18 If no specific client program is given on the command line, xinit will
19 look for a file in the user's home directory called .xinitrc to run as
20 a shell script to start up client programs. If no such file exists,
21 xinit will use the following as a default:
22
23 xterm -geometry +1+1 -n login -display :0
24
25
26 If no specific server program is given on the command line, xinit will
27 look for a file in the user's home directory called .xserverrc to run
28 as a shell script to start up the server. If no such file exists,
29 xinit will use the following as a default:
30
31 X :0
32
33 Note that this assumes that there is a program named X in the current
34 search path. However, servers are usually named Xdisplaytype where
35 displaytype is the type of graphics display which is driven by this
36 server. The site administrator should, therefore, make a link to the
37 appropriate type of server on the machine, or create a shell script
38 that runs xinit with the appropriate server.
39
40 Note, when using a .xserverrc script be sure to ``exec'' the real X
41 server. Failing to do this can make the X server slow to start and
42 exit. For example:
43
44 exec Xdisplaytype
45
46 An important point is that programs which are run by .xinitrc should be
47 run in the background if they do not exit right away, so that they
48 don't prevent other programs from starting up. However, the last long-
49 lived program started (usually a window manager or terminal emulator)
50 should be left in the foreground so that the script won't exit (which
51 indicates that the user is done and that xinit should exit).
52
53 An alternate client and/or server may be specified on the command line.
54 The desired client program and its arguments should be given as the
55 first command line arguments to xinit. To specify a particular server
56 command line, append a double dash (--) to the xinit command line
57 (after any client and arguments) followed by the desired server com‐
58 mand.
59
60 Both the client program name and the server program name must begin
61 with a slash (/) or a period (.). Otherwise, they are treated as an
62 arguments to be appended to their respective startup lines. This makes
63 it possible to add arguments (for example, foreground and background
64 colors) without having to retype the whole command line.
65
66 If an explicit server name is not given and the first argument follow‐
67 ing the double dash (--) is a colon followed by a digit, xinit will use
68 that number as the display number instead of zero. All remaining argu‐
69 ments are appended to the server command line.
70
72 Below are several examples of how command line arguments in xinit are
73 used.
74
75 xinit This will start up a server named X and run the user's .xini‐
76 trc, if it exists, or else start an xterm.
77
78 xinit -- /usr/X11R6/bin/Xqdss :1
79 This is how one could start a specific type of server on an
80 alternate display.
81
82 xinit -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy
83 This will start up a server named X, and will append the given
84 arguments to the default xterm command. It will ignore .xini‐
85 trc.
86
87 xinit -e widgets -- ./Xsun -l -c
88 This will use the command .Xsun -l -c to start the server and
89 will append the arguments -e widgets to the default xterm com‐
90 mand.
91
92 xinit /usr/ucb/rsh fasthost cpupig -display ws:1 -- :1 -a 2 -t 5
93 This will start a server named X on display 1 with the argu‐
94 ments -a 2 -t 5. It will then start a remote shell on the
95 machine fasthost in which it will run the command cpupig,
96 telling it to display back on the local workstation.
97
98 Below is a sample .xinitrc that starts a clock, several terminals, and
99 leaves the window manager running as the ``last'' application. Assum‐
100 ing that the window manager has been configured properly, the user then
101 chooses the ``Exit'' menu item to shut down X.
102
103 xrdb -load $HOME/.Xresources
104 xsetroot -solid gray &
105 xclock -g 50x50-0+0 -bw 0 &
106 xload -g 50x50-50+0 -bw 0 &
107 xterm -g 80x24+0+0 &
108 xterm -g 80x24+0-0 &
109 twm
110
111 Sites that want to create a common startup environment could simply
112 create a default .xinitrc that references a site-wide startup file:
113
114 #!/bin/sh
115 . /usr/local/lib/site.xinitrc
116
117 Another approach is to write a script that starts xinit with a specific
118 shell script. Such scripts are usually named x11, xstart, or startx
119 and are a convenient way to provide a simple interface for novice
120 users:
121
122 #!/bin/sh
123 xinit /usr/local/lib/site.xinitrc -- /usr/X11R6/bin/X bc
124
125
127 DISPLAY This variable gets set to the name of the display to
128 which clients should connect.
129
130 XINITRC This variable specifies an init file containing shell
131 commands to start up the initial windows. By default,
132 .xinitrc in the home directory will be used.
133
135 .xinitrc default client script
136
137 xterm client to run if .xinitrc does not exist
138
139 .xserverrc default server script
140
141 X server to run if .xserverrc does not exist
142
144 X(7), startx(1), Xserver(1), xterm(1)
145
147 Bob Scheifler, MIT Laboratory for Computer Science
148
149
150
151X Version 11 xinit 1.0.2 XINIT(1)