Re: Checking if the X Server is running

2007-10-02 Thread O. Olson

--- Holger Krull ha scritto:

 Holger Krull schrieb:
  Holger Krull schrieb:
  I was to fast on my last email. I tested it now:
  You need (on windows):
  set DISPLAY=127.0.0.1:0.0 c:\cygwin\bin\bash.exe
 -l /home/krull/test.sh
  
  (it is important that there is no space between
 0.0 and )
  
  test.sh:
  #!/bin/sh
  ps |grep -i /xwin /dev/null
  if [ $? -eq 0 ]
  then
 xterm -e /usr/bin/bash -l 
  else
 run XWin :2 -multiwindow -clipboard
 -silent-dup-error
 
 that :2 is from my testing, sorry, doesn't belong
 there
 
 xterm -e /usr/bin/bash -l 
  fi
  

Thanks Holger. Now this works perfectly. It does open
up a Windows cmd window – which remains open until I
finish with my app – but I can live with that. 

Thanks Phil Betts – I think now the checkX script also
works. I think my mistake was I was leaving a space
between set DISPLAY=127.0.0.1:0.0 and  - Thankfully
Holger pointed this out. 

O.O. 



  ___ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html

--
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/



Re: Checking if the X Server is running

2007-10-02 Thread Holger Krull
As someone pointed out in another post the sequence ps |grep has a risk of 
finding grep itself in the list. The command pgrep combines both and hasn't 
that risk.
 
 Thanks Holger. Now this works perfectly. It does open
 up a Windows cmd window – which remains open until I
 finish with my app – but I can live with that. 

That can be avoided by dual nested start like:
C:\cygwin\bin\bash.exe -c -l 'run bash -c -l Xwin.exe :0 -query 192.168.11.1 
-once  '

The first bash closes after the command and so does the cmd window which 
started it. The  at the end is important to get a independend process.

--
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/



Re: Checking if the X Server is running

2007-10-02 Thread Matthew Wozniski
On Mon, Oct 01, 2007 at 05:33:12PM +0100, Phil Betts wrote:
 It's probably not the cause of your problem, but you should
 never use ps | grep xxx to detect if a process is running.
 This is because the grep process will (sometimes) detect 
 itself and give you a false positive, and your xterm will 
 try to start when there is no server running.

A just a random snippet that I find useful for preventing just that:
ps | grep xterm
matches itself, since the command line contains 'xterm'.

ps | grep '[x]term'
doesn't match itself, since the command line no longer contains the
string 'xterm'.

It's more portable than
pgrep xterm

and it's less ugly than
ps | grep xterm | grep -v grep

So it's what I usually find myself using.

~Matt

--
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/



RE: Checking if the X Server is running

2007-10-02 Thread Jörg Schaible
[EMAIL PROTECTED] wrote on Tuesday, October 02, 2007 4:21 PM:

 On Mon, Oct 01, 2007 at 05:33:12PM +0100, Phil Betts wrote:
 It's probably not the cause of your problem, but you should
 never use ps | grep xxx to detect if a process is running.
 This is because the grep process will (sometimes) detect
 itself and give you a false positive, and your xterm will
 try to start when there is no server running.
 
 A just a random snippet that I find useful for preventing just that:
 ps | grep xterm matches itself, since the command line contains
 'xterm'. 
 
 ps | grep '[x]term'
 doesn't match itself, since the command line no longer contains the
 string 'xterm'. 
 
 It's more portable than
 pgrep xterm
 
 and it's less ugly than
 ps | grep xterm | grep -v grep
 
 So it's what I usually find myself using.

pidof XWin

- Jörg

--
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/



Re: Checking if the X Server is running

2007-10-02 Thread O. Olson

--- Holger Krull ha scritto:

 As someone pointed out in another post the sequence
 ps |grep has a risk of finding grep itself in the
 list. The command pgrep combines both and hasn't
 that risk.

Thanks for this tip. 
 
 
 That can be avoided by dual nested start like:
 C:\cygwin\bin\bash.exe -c -l 'run bash -c -l
 Xwin.exe :0 -query 192.168.11.1 -once  '
 
 The first bash closes after the command and so does
 the cmd window which started it. The  at the end is
 important to get a independend process.
 

I don’t think I managed to get this to work. This
seems to open a single big window for cygwin – which
is not want I wanted. So I then went in and added the
–multiwindow flag. With this, I again got that error
i.e. error dialog. 

I actually want to find a way to execute graphical
applications by this method. So with this method –
even if we succeed, would not allow me to start up a
graphical application. So I went ahead and edited this
– so that it runs a shell script instead of XWin.exe –
however with that I either get the error dialog, or
nothing works. 

O.O. 



  ___ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html

--
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/



Cygwin/X remote desktop

2007-10-02 Thread Jeeva Chelladhurai
Hello,

I am new bee here.

I am using Cygwin/X from my windows XP box to connect to my
development linux system via SSH X-port-forwarding. When I remote
desktop to windows XP, all the X windows slow down heavily. How do I
fix this issue?

Thanks,
Jeeva

--
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/