xinit(Enhanced X-Windows) Command Purpose Starts an X Server and clients with a single command. Syntax xinit [ServerOptions] Description The xinit command is a shell script that starts the X Server and any X client programs. The xinit command uses a customizable shell script file that lists the X client programs to start. 1. The xinit command first looks for the $XINITRC environment variable to start the client programs. 2. If the $XINITRC environment variable is not found, it looks for the $HOME/.xinitrc shell script. 3. If the $HOME/.xinitrc shell script is not found, the xinit command starts the /usr/lib/X11/$LANG/xinitrc shell script. 4. If /usr/lib/X11/$LANG/xinitrc is not found, it looks for the /usr/lpp/X11/defaults /$LANG/xinitrc shell script. 5. If that script is not found, it searches for the /usr/lpp/X11/defaults/xinitrc shell script. The xinitrc shell script starts commands such as the mwm (AIXwin- dows window manager), aixterm, and xclock commands. The xinit command performs the following operations: * Starts an X Server on the current display. * Sets up the $DISPLAY environment variable. * Runs the xinitrc file to start the X client programs. * Automatically loads the Display PostScript Level 2 (dps) exten- sion for AIXwindows 1.2.5. To prevent DPS from automatically loading, the /usr/lpp/X11/xinit file must be modified. You can exit from Enhanced X-Windows by pressing the Ctrl-Alt- Backspace key sequence. Implementation Specifics This command is part of AIXwindows Run Time Environment in AIXwindows Environment/6000. Related Information The aixterm command, mwm command, xclock command in Commands Reference. List of Enhanced X-Windows Xlib Functions in Technical Reference Volume 7: User Interface. List of Enhanced X-Windows Protocols, Toolkit, and Extension Functions in Technical Reference Volume 8: User Interface. Enhanced X-Windows Commands Overview in User Interface Program- ming Concepts Volume 1. Introducing AIXwindows in User Interface Programming Concepts Volume 1. Enhanced X-Windows Overview in User Interface Programming Con- cepts Volume 1. xinit(X11R5) Command Purpose Initializes the X Window System. Syntax xinit [ [ Client ] Options ] [ - - [ Server ] [ Display ] Options ] Description The xinit command starts the AIXwindows server and a first client program on systems that cannot start X directly from /etc/init or in environments that use multiple window systems. When this first client exits, the xinit command stops the X server and then ends. If no specific client program is given on the command line, the xinit command looks for a file to run to start up client pro- grams. The xinit command looks for the $XINITRC environment var- iable. If the file is not there, it then looks for the $HOME/.xinitrc file. If it still does not find the file, it fol- lows these steps: 1. The xinit command looks next to /usr/lib/X11/$LANG/xinitrc. 2. Next, it looks to /usr/lpp/X11/defaults/$LANG/xinitrc. 3. And finally, it looks to /usr/lpp/X11/defaults/xinitrc. If no such file exists, xinit uses the following as a default: aixterm \-geometry +1+1 \-n login \-display :0 If no specific server program is given on the command line, the xinit command follows these steps: 1. The xinit command looks for a file to run as a shell script to start up the server. The xinit command looks for files first in the $XSERVERRC environment variable. 2. If the file is not there, it looks for the $HOME/.xserverrc file. 3. If it still does not find the $HOME/.xserverrc file, it looks next to /usr/lpp/X11/defaults/xserverrc file. 4. And finally, if it does not find any of the previous files, the xinit command runs the X command to start the X server and uses the following as a default: X :0 Note that this assumes that there is a program named X in the current search path. However, servers are usually named Xdisplaytype where displaytype is the type of graphics display which is driven by this server. The site administrator should, therefore, make a link to the appropriate type of server on the machine, or create a shell script that runs the xinit command with the appropriate server. Note: If you attempt to start AIXwindows without an available pointer device, such as a mouse or a tablet, AIXwindows will not open. Some devices can be plugged in but not defined and thus not available to the system, as well as the reverse. An important point is that programs which are run by .xinitrc should be run in the background if they do not exit right away, so that they do not prevent other programs from starting up. However, the last long-lived program started (usually a window manager or terminal emulator) should be left in the foreground so that the script does not exit (which indicates that the user is done and that xinit should exit). An alternate client and/or server may be specified on the command line. The desired client program and its arguments should be given as the first command line arguments to xinit. To specify a particular server command line, add a ¾ (double dash) to the xinit command line (after any client and arguments) followed by the desired server command. Both the client program name and the server program name must be- gin with a / (slash) or a . (period). Otherwise, they are treat- ed as an arguments to be added to their respective startup lines. This makes it possible to add arguments (for example, foreground and background colors) without having to retype the whole command line. If a clear server name is not given and the first argument fol- lowing the ¾ (double dash) is a : (colon) followed by a number, xinit uses that number as the display number instead of zero. All remaining arguments are added to the server command line. The following environment variables are used with the xinit com- mand: DISPLAY This variable gets set to the name of the display to which clients should connect. XINITRC This variable specifies an init file containing shell commands to start up the initial windows. By default, .xinitrc in the home directory is used. Options List any option you wish that is available to the client you specified. Client Specify the client with which you are working. For exam- ple, xterm or aixterm. The client you specify must begin with a . (dot) or a / (slash). Server Use any valid xserver. The server you specify must begin with a . (dot) or a / (slash). Examples 1. To start up a server named X and run the user's xinitrc program, if it exists, or else start an aixterm command enter: xinit 2. To start a specific type of server on an alternate display, enter: xinit -- /usr/bin/X11/X qdss:1 3. To start up a server named X, and add the given arguments to the default xinitrc or aixterm command, enter: xinit -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy 4. To use the command /Xsun -l -c to start the server and add the arguments -e widgets to the default xinitrc or aixterm command, enter: xinit -e widgets -- ./Xsun -l -c 5. To start a server named X on display 1 with the arguments -a 2 -t 5, then start a remote shell on the machine fasthost in which it runs the command cpupig, telling it to display back on the lo- cal workstation, enter: xinit /usr/ucb/rsh fasthost cpupig -display ws:1 -- :1 -a 2 -t 5 6. The following sample of the .xinitrc script starts a clock, several terminals, and leaves the window manager running as the last application. Assuming that the window manager has been con- figured properly, the user then chooses the Exit menu item to end the AIXwindows session. xrdb -load $HOME/.Xresources 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 & mwm 7. Sites that want to create a common startup environment could simply create a default .xinitrc script that references a site- wide startup file: #!/bin/sh . /usr/local/lib/site.xinitrc 8. Another approach is to write a script that starts the xinit command with a specific shell script. Such scripts are usually named x11, xstart, or startx and are a convenient way to provide a simple interface for novice users: #!/bin/sh xinit /usr/local/lib/site.xinitrc -- /usr/bin/X11/X bc Implementation Specifics This command is part of AIXwindows Run Time Environment in AIXwindows Environment/6000. Files .xinitrc Contains the default client script files. aixterm Contains the command the client runs if .xinitrc does not exist. .xserverrc Contains the default server script. X Contains the command the server runs if .xserverrc does not exist. Related Information The startx command, X command. List of Enhanced X-Windows Xlib Functions in Technical Reference Volume 7: User Interface. List of Enhanced X-Windows Protocols, Toolkit, and Extension Functions in Technical Reference Volume 8: User Interface. Enhanced X-Windows Overview in User Interface Programming Con- cepts Volume 1. Enhanced X-Windows Commands Overview in User Interface Program- ming Concepts Volume 1.