public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* RE: Convenient script for starting an XFree86 xterm
@ 2004-03-02 15:06 Thomas Chadwick
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Chadwick @ 2004-03-02 15:06 UTC (permalink / raw)
  To: cygwin-xfree

FYI - You might want to consider using /usr/X11R6/bin/run.exe (the DOS path 
being c:\cygwin\usr\X11R6\bin\run) in place of the 1-liner VBScript.  Makes 
things a wee bit cleaner, IMHO.

>From: ncokwqc02@sneakemail.com
>Reply-To: cygwin-xfree@cygwin.com
>To: cygwin-xfree@cygwin.com
>Subject: Convenient script for starting an XFree86 xterm
>Date: Mon, 1 Mar 2004 22:37:52 -0800
>
>I've seen some other postings on this subject recently, so I'm submitting
>this contribution as a potential starting point for others.
>
>I have convenient Windows desktop shortcuts to start up a Cygwin/Bash shell
>window and an RXVT/Bash shell window. I was looking for something similar 
>to
>start up a Cygwin/XFree86 xterm. Of course, I didn't want to generate
>multiple running copies of the 'XWin' server, nor did I want useless 
>Command
>prompt windows hanging around.
>
>Here's what I came up with. I make no claim to generality, robustness,
>cleverness, originality or anything else. It just works for me.
>
>
>It consists of three parts:
>
>1) A desktop shortcut with the following target:
>C:\WINNT\SYSTEM32\WSCRIPT.EXE "C:\cygwin\invisible.vbs"
>"C:\cygwin\XFree86xterm.bat"
>
>2) A VB shell script named 'C:\cygwin\invisible.vbs' containing the single
>line:
>CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0,
>False
>
>3) A DOS shell script named 'C:\cygwin\XFree86xterm.bat' containing the
>following lines:
>-------------------------------------------------------------------
>@echo off
>
>ps -ef | grep /usr/X11R6/bin/XWin > nul
>
>if ERRORLEVEL 1 (
>   start /DC:\cygwin\usr\X11R6\bin /B XWin -multiwindow -clipboard
>)
>
>set DISPLAY=localhost:0.0
>
>C:\cygwin\usr\X11R6\bin\xterm -fn 10x20 -sl 1000 -sb -leftbar -ms red -fg
>yellow -bg black -e /usr/bin/bash --login -i
>-------------------------------------------------------------------
>
>Description:
>- The shortcut starts the Windows scripting language, which runs the simple
>Visual Basic script.
>- The VB script runs the DOS shell script without generating a Command
>window.
>- The DOS shell script
>   - Starts 'XWin' with my preferred switches as a background process if no
>such process is already running,
>   - Sets DISPLAY to the 'localhost:0.0', which the 'xterm' will inherit, 
>and
>   - Starts a login bash shell in an XFree86 xterm with some decent extra
>settings.
>
>john
>

_________________________________________________________________
Get business advice and resources to improve your work life, from bCentral. 
http://special.msn.com/bcentral/loudclear.armx


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

* Re: Convenient script for starting an XFree86 xterm
@ 2004-03-06 10:21 frederic bregier
  0 siblings, 0 replies; 4+ messages in thread
From: frederic bregier @ 2004-03-06 10:21 UTC (permalink / raw)
  To: cygwin-xfree

I try a previously proposed set of scripts 
to launch xterm from an icon and I found some
difficulties (mainly PATH set).
I keep the same approach, just correct some problem
I found (PATH related), in case any needs them.
So here is my proposition to correct this :

1) Create a shorcut as said before to

C:\cygwin\usr\X11R6\bin\run.exe /XFree86xterm.bat

and set PATH for execution to 

C:\cygwin\bin

and not to the default C:\cygwin\usr\X11R6\bin
(not found cygwin1.dll except of course if your
global PATH include this but not mandatory for Cygwin
to run).

2) Create the bat shell XFree86xterm.bat in C:\cygwin\
--------

@echo off
SET CYGWIN_ROOT=\cygwin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
set DISPLAY=localhost:0.0

ps -ef | grep /usr/X11R6/bin/XWin > nul

if ERRORLEVEL 1 (
  start XWin -multiwindow -clipboard -xkblayout fr -xkbmodel pc105
-unixkill -winkill
)

xterm -fn 10x20 -sl 1000 -sb -leftbar -ms red -fg yellow -bg black -e
/usr/bin/bash --login -i

--------
I change here to set Cygwin_root and PATH since again this is not
mandatory in Cygwin to set them globally, remove some options
to start command (/B and /D) and replace full path by simply calling
'xterm'.
Of course change '-xkblayout fr' options in XWin to your need, even
remove it.
The same for all options of XWin.

Well, now, for me, without setting anything in global configuration
(PATH in windows env), it works just fine.

Frederic



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

* RE: Convenient script for starting an XFree86 xterm
@ 2004-03-02 18:42 ncokwqc02
  0 siblings, 0 replies; 4+ messages in thread
From: ncokwqc02 @ 2004-03-02 18:42 UTC (permalink / raw)
  To: cygwin-xfree

Thomas,

Thanks for the tip. I hadn't known about '/usr/X11R6/bin/run.exe'.

Now that I am aware of it, I'm not finding much documentation about it.
However, it does improve upon my offering by simplifying it.

As you suggested, I can eliminate the VBScript and replace the target in my
shortcut by

C:\cygwin\usr\X11R6\bin\run.exe /XFree86xterm.bat

where '/XFree86xterm.bat' points to the DOS script I described earlier. The
new procedure is simpler and works just as well.

A minor drawback to both procedures is that one cannot take advantage of
Windows' facility to position new windows to avoid complete overlap. I
suppose it's being applied to the non-existent Command prompt window rather
than the 'xterm'.

john


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

* Convenient script for starting an XFree86 xterm
       [not found] <Pine.GSO.4.56.0402282039060.19703@slinky.cs.nyu.edu>
@ 2004-03-02  6:38 ` ncokwqc02
  0 siblings, 0 replies; 4+ messages in thread
From: ncokwqc02 @ 2004-03-02  6:38 UTC (permalink / raw)
  To: cygwin-xfree

I've seen some other postings on this subject recently, so I'm submitting
this contribution as a potential starting point for others.

I have convenient Windows desktop shortcuts to start up a Cygwin/Bash shell
window and an RXVT/Bash shell window. I was looking for something similar to
start up a Cygwin/XFree86 xterm. Of course, I didn't want to generate
multiple running copies of the 'XWin' server, nor did I want useless Command
prompt windows hanging around.

Here's what I came up with. I make no claim to generality, robustness,
cleverness, originality or anything else. It just works for me.


It consists of three parts:

1) A desktop shortcut with the following target:
C:\WINNT\SYSTEM32\WSCRIPT.EXE "C:\cygwin\invisible.vbs"
"C:\cygwin\XFree86xterm.bat"

2) A VB shell script named 'C:\cygwin\invisible.vbs' containing the single
line:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0,
False

3) A DOS shell script named 'C:\cygwin\XFree86xterm.bat' containing the
following lines:
-------------------------------------------------------------------
@echo off

ps -ef | grep /usr/X11R6/bin/XWin > nul

if ERRORLEVEL 1 (
  start /DC:\cygwin\usr\X11R6\bin /B XWin -multiwindow -clipboard
)

set DISPLAY=localhost:0.0

C:\cygwin\usr\X11R6\bin\xterm -fn 10x20 -sl 1000 -sb -leftbar -ms red -fg
yellow -bg black -e /usr/bin/bash --login -i
-------------------------------------------------------------------

Description:
- The shortcut starts the Windows scripting language, which runs the simple
Visual Basic script.
- The VB script runs the DOS shell script without generating a Command
window.
- The DOS shell script
  - Starts 'XWin' with my preferred switches as a background process if no
such process is already running,
  - Sets DISPLAY to the 'localhost:0.0', which the 'xterm' will inherit, and
  - Starts a login bash shell in an XFree86 xterm with some decent extra
settings.

john


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

end of thread, other threads:[~2004-03-06 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-02 15:06 Convenient script for starting an XFree86 xterm Thomas Chadwick
  -- strict thread matches above, loose matches on Subject: below --
2004-03-06 10:21 frederic bregier
2004-03-02 18:42 ncokwqc02
     [not found] <Pine.GSO.4.56.0402282039060.19703@slinky.cs.nyu.edu>
2004-03-02  6:38 ` ncokwqc02

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).