public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Windows Batch File to start xterm on Cygwin/X 1.7.x
@ 2010-01-25 22:53 Zheng-Da Tan
  2010-02-03 19:47 ` Jon TURNEY
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng-Da Tan @ 2010-01-25 22:53 UTC (permalink / raw)
  To: cygwin-xfree

I like to have one icon in Windows that I can click on to open a new
xterm window:
   - if the X server is not running, the icon would start X and launch
a xterm window
   - if the X server is running, it will simply open a new xterm
window on the existing X server

This was how it used to work by default in a very old version of
Cygwin.  It had been broken once before (search silent-dup-error in
the mailing list archives), fixed, and now broken again when
startxwin.bat became startxwin.exe.  So I've put together this batch
file that makes things work again on the latest version of Cygwin
1.7.1

$ cat startCygwinX.bat
@ECHO OFF

SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET RUN=%CYGWIN_ROOT%\bin\run -p /usr/bin

tasklist | \WINDOWS\system32\find.exe "XWin.exe"
if errorlevel 1 (
%RUN% bash.exe -l -c startxwin.exe
) ELSE (
%RUN% xterm -sb -rightbar -bg black -fg white +tb -sl 1000 -e /usr/bin/bash -l
)

Point a Windows icon to this batch file above, and you have one icon
to do it all.

I hope this is helpful to someone out there!

Best regards,

-- 
tzd.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Windows Batch File to start xterm on Cygwin/X 1.7.x
  2010-01-25 22:53 Windows Batch File to start xterm on Cygwin/X 1.7.x Zheng-Da Tan
@ 2010-02-03 19:47 ` Jon TURNEY
  0 siblings, 0 replies; 2+ messages in thread
From: Jon TURNEY @ 2010-02-03 19:47 UTC (permalink / raw)
  To: cygwin-xfree; +Cc: tzdlist

On 25/01/2010 22:53, Zheng-Da Tan wrote:
> I like to have one icon in Windows that I can click on to open a new
> xterm window:
>     - if the X server is not running, the icon would start X and launch
> a xterm window
>     - if the X server is running, it will simply open a new xterm
> window on the existing X server
>
> This was how it used to work by default in a very old version of
> Cygwin.  It had been broken once before (search silent-dup-error in
> the mailing list archives), fixed, and now broken again when
> startxwin.bat became startxwin.exe.

How about saying how it's broken, so it can be fixed, and we can get rid of 
horrible batch files for ever?

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-03 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-25 22:53 Windows Batch File to start xterm on Cygwin/X 1.7.x Zheng-Da Tan
2010-02-03 19:47 ` Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).