bat File to Launch Remote X11 Application

Takashi Yano takashi.yano@nifty.ne.jp
Tue Nov 23 00:07:28 GMT 2021


On Mon, 22 Nov 2021 14:15:32 -0500
Dennis Putnam wrote:
> I have a remote X application on a Linux system that I want to launch 
> with a Windows bat file. My main problem is how to determine if Cygwin/X 
> is running and if not launch it. Once verified I think all I need to do 
> is use SSH -Y with the command that starts the X application. Can 
> someone help? TIA.

What about something like:

set DISPLAY=:0
for /f "usebackq delims=" %%A in (`tasklist ^|find /C "XWin"`) do if %%A==0 start C:\cygwin64\bin\XWin %DISPLAY% -multiwindow
c:\cygwin64\bin\ssh -Y 192.168.0.133 xterm

Note that the above bat fails to start XWin if it is already
started with DISPLAY other than :0.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


More information about the Cygwin mailing list