Harold,
... but the true difficulty in that is communicating the assigned
display number back to the shell from which XWin was launched so that X
programs can know the correct display to connect to.
Why not have XWin write its display number to a file in /var/run, e.g.,
/var/run/XWin.$$.display, where "$$" stands for the PID of the XWin
process? Since anyone who started XWin in the background from a shell
script will have access to its PID via $!, the following idiom will work:
XWin -multiwindow -emulate3buttons &
XWINPID=$!
DISPLAY_FILE=/var/run/XWin.$XWINPID.display
while [ ! -e "$DISPLAY_FILE" ]; do sleep 1; done
DISPLAY="`cat "$DISPLAY_FILE"`"
Unfortunately, this approach won't work from .bat scripts (since they
aren't aware of Cygwin process IDs). It also won't work if "cygstart
XWin" is used. Any ideas on how to address it?
Igor