Section: User Commands (1)
Updated: xinit 1.3.2
Index Return to Main Contents


startxwin - Cygwin XWin server initializer  


startxwin [ [ client ] client_options ... ] [ -- [ display ] server_options ... ]  


The startxwin program is used to start the Cygwin XWin server in multi-window mode and a first client program.

If no specific client program is given on the command line, startxwin will look for a file in the user's home directory called .startxwinrc to run as a shell script to start up client programs. If no such file exists, startxwin will use the following as a default:

       xterm -geometry +1+1 -n login -display :0

An important point is that programs which are run by .startxwinrc should be run in the background if they do not exit right away, so that they don't prevent other programs from starting up.

An alternate client and/or server command may be specified on the command line. The desired client program and its arguments should be given as the first command line arguments to startxwin. To specify particular server options, append a double dash (--) to the startxwin command line (after any client and arguments) followed by the desired server options. startxwin always supplies the -multiwindow option to the X server.

The client program name name must begin with a slash (/) or a period (.). Otherwise, it is treated as an argument to be appended to the client startup command. This makes it possible to add arguments (for example, foreground and background colors) without having to retype the whole command line.

If the first argument following the double dash (--) is a colon followed by a digit, startxwin will use that number as the display number instead of zero. All remaining arguments are appended to the server command line.



Below are several examples of how command line arguments in startxwin are used.
This will start up an XWin server and run the user's .startxwinrc, if it exists, or else start an xterm.
startxwin -- :1
This is how one could start the server on an alternate display.
startxwin -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy
This will start up the server, and will append the given arguments to the default xterm command. It will ignore .startxwinrc.
startxwin /usr/bin/ssh -Y username@fasthost cpupig -display ws:1 -- :1 -a 2 -t 5
This will start a server 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 .startxwinrc that starts a clock and several terminals.

xrdb -load $HOME/.Xresources
xclock -g 50x50-0+0 -bw 0 &
xload -g 50x50-50+0 -bw 0 &
xterm -g 80x24+0+0 &
xterm -g 80x24+0-0 &

Sites that want to create a common startup environment could simply create a default .startxwinrc that references a site-wide startup file:

. /usr/local/lib/site.startxwinrc

Another approach is to write a script that starts startxwin 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:

startxwin /usr/local/lib/site.startxwinrc -- -br



This variable gets set to the name of the display to which clients should connect.
This variable specifies an init file containing shell commands to start up the initial windows. By default, .startxwinrc in the home directory will be used.


default client script
client to run if .startxwinrc does not exist


xinit(1) X(7), Xserver(1), XWin(1), XWinrc(5), xterm(1)




This document was created by man2html, using the manual pages.
Time: 18:12:10 GMT, January 26, 2014