Igor Pechtchanski wrote:

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

Batch scripts was more of my concern... it would be possible to do from a Cygwin shell like you describe (though I did not have all of the tricks in mind).


Maybe the solution is to make the batch files just launch a shell script to do the heavy lifting... sort of cheating but if it makes it possible then it is acceptable to me.

Harold

Reply via email to