xinit command_examples
xinit – X Window System initializer
Below are several examples of how command line arguments in xinit are used.
xinit This will start up a server named X and run the user’s .xinitrc, if it exists, or else start an xterm.
xinit -- /usr/bin/Xvnc :1
This is how one could start a specific type of server on an alternate display.
xinit -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy
This will start up a server named X, and will append the given arguments to the default xterm command. It will ignore .xinitrc.
xinit -e widgets -- ./Xorg -l -c
This will use the command .Xorg -l -c to start the server and will append the arguments -e widgets to the default xterm command.
xinit /usr/ucb/rsh fasthost cpupig -display ws:1 -- :1 -a 2 -t 5
This will start a server named X on display 1 with the arguments -a 2 -t 5. It will then start a remote shell on the machine fasthost in which it will run the command cpupig, telling it to display back on the local workstation.
Below is a sample .xinitrc that starts a clock, several terminals, and leaves the window manager running as the “last” application. Assuming that the window manager has been configured properly, the user then chooses the “Exit” menu item to shut down X.
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 & twm
Sites that want to create a common startup environment could simply create a default .xinitrc that references a site-wide startup file:
#!/bin/sh . /etc/X11/xinit/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 for novice users:
#!/bin/sh xinit /etc/X11/xinit/site.xinitrc -- /usr/bin/X -br