This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reset/terminate problems; preventing multiple XWin instances


>I see that it's in 4.3.0-50 and working well, but I don't see how the
>current implementation addresses the common task I mentioned:
>"open an xterm; run XWin first if needed"
>If I use a batchfile that always runs XWin and then xterm, from the 2nd
>invocation onwards it will produce the error popup reporting a "Fatal
>error" and directing me a to log file... Not quite what's needed here.[1]
>
>Perhaps there should be a switch that says "if the display already
>exists, exit silently".

Hi Eran,

I had the same problem and have solved it with the following Batch file:
-------------
@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%

REM Find a running version of XWin
c:\progra~1\resour~1\pulist |c:\progra~1\resour~1\qgrep XWin >nul
REM if Xwin is running then start an Xterm
if errorlevel 1 goto NEXT 
run C:\cygwin\usr\X11R6\bin\xterm -cr red -sl 1000 -sb -rightbar -ms red 
-fg white -bg black -e /usr/bin/bash --login
goto END

:NEXT
REM Delete temp and lock file and start XWin and Xterm.
attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0 >nul
del %CYGWIN_ROOT%\tmp\.X11-unix\X0 >nul
start C:\cygwin\usr\X11R6\bin\XWin.exe -multiplemonitors -multiwindow -dpi 
100 -clipboard
run C:\cygwin\usr\X11R6\bin\xterm -cr red -sl 1000 -sb -rightbar -ms red 
-fg white -bg black -e /usr/bin/bash --login
:END
---------------
You will need pulist and qgrep which is included in w2k resource kit. 
Should you not have this then please contact me offlist cygwin@nai.nu

Basically this batch file start Xwin if pulist (like ps but for windows) 
does not return a XWin process.

Hope this helps

-- 
Kind regards
Geordy Korte


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]