xinit(1X) xinit(1X)NAMETMxinit - initializes the X Window SystemSYNOPSIS xinit [[client] [ client-option] ...] [--[[server][:display-number][server-option]...]] DESCRIPTION xinit starts the X Window System server and a first client application (usually a terminal emulator) on systems that cannot start X directly from /etc/init or in environments that use multiple window systems. When the first client ex- its, xinit terminates the X server and then itself ter- minates. Arguments An alternate client application or an alternate server, or both, may be specified on the command line. client Specifies the client application to start. If a server is also specified, client must precede the server on the xinit command line. If client is not specified, xinit looks for a file in your home directory called .xinitrc to run as a shell script to start client applications. If .xinitrc does not exist, xinit uses xterm -geometry +1+1 -n login -display :0 as the de- fault. client-option Specifies command-line options for client. server Specifies the server to start. The server argument must be placed after client on the xinit command line and must be preceded by a double hyphen (--). If server is not specified, xinit looks for a file in your home directory called .xserverrc to run as a shell script to start the server. If .xserverrc does not exist, xinit uses XmacII :0 as the default. Note that this assumes that XmacII is in the current search path. : display-number Specifies the display on which to start the server. The colon (:) must appear after the double hyphen (--) and server, if supplied, and must be followed by display-number, which is a number that xinit uses as the display number instead of 0. server-option November, 1990 1
xinit(1X) xinit(1X)Specifies command-line options for server. Servers are usually named Xdisplaytype where displaytype is the type of graphics display that is driven by this server. Therefore, the site administrator should make a link to the appropriate type of server on the machine or create a shell script that runs xinit with the appropriate server. Client applications run by .xinitrc and by .xserverrc should be run in the background if they do not exit right away, so that they don't prevent other client applications from starting. However, the last long-lived client application started, usually a window manager or terminal emulator, should be left in the foreground so that the script won't exit, which indicates that you are done and that xinit should exit. Environment variables The xinit command uses the following environment variables: DISPLAY Specifies the default host, display number, and screen. This variable is inherited by all client ap- plications. XINITRC Specifies a file containing shell commands to start up the initial windows. By default, .xinitrc in the home directory is used. EXAMPLES Here are several examples of how to use xinit. You will also find examples of how to write and use a .xinitrc file or other shell script to start client applications. To start a server named X and run the .xinitrc file in your home directory, or to start xterm if you do not have a .xinitrc file, use xinit To start a specific type of server on an alternate display, use xinit -- /usr/bin/X11/Xqdss :1 To start a server named X, to ignore your .xinitrc file, if it exists, and to append the given arguments to the default xterm command, use 2 November, 1990
xinit(1X) xinit(1X)xinit -geometry =80x65+10+10 -fn 8x13 -j \ -fg white -bg navy To use the command ./XmacII -l -c for starting the server and to append -e widgets to the default xterm command, use xinit -e widgets -- ./XmacII -l -c The next example starts on display 1 a server named X with the -a and -t options. The example then starts a remote shell on the machine fasthost on which it runs the command cpupig, telling cpupig to display back on the local worksta- tion. xinit /usr/ucb/rsh fasthost cpupig -display \ ws:1 -- :1 -a 2 -t 5 The following example is an .xinitrc file that starts a clock, several terminals, and leaves the window manager run- ning as the last application. Assuming that the window manager has been configured properly, you can choose the window manager's ``Kill twm'' menu item to shut down X. xrdb -load $HOME/.Xres xsetroot -solid gray & xclock -g 50x50-0+0 -bw 0 & xload -g 50x50-50+0 -bw 0 & xterm -g 80x24+0+0 & xterm -g 80x24+0-0 & twm A system administrator who wants to create a common startup environment at a site could simply create a default .xinitrc that references a site-wide startup file. #!/bin/sh . /usr/local/lib/site.xinitrc Another approach is to write a script that starts xinit with a specific shell script. Such scripts are usually named x11, xstart, or startx and are a convenient way to provide a simple interface. #!/bin/sh xinit /usr/local/bin/startx -- /usr/bin/X11/Xhp :1 NOTES Copyright 1988, Massachusetts Institute of Technology. See X(1X) for a full statement of rights and permissions. November, 1990 3
xinit(1X) xinit(1X)Author: Bob Scheifler, MIT Laboratory for Computer Science SEE ALSO X(1X), XmacII(1X), xrdb(1X), xterm(1X) 4 November, 1990