This is the mail archive of the cygwin-xfree 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: modification of startx.bat not work


Dirk Schleicher wrote on Tuesday, July 25, 2006 9:48 AM::

> Am Tue, 25 Jul 2006 03:16:51 -0500
> schrieb René Berber <r.berber@xxxxxxxx.xxx>:
> 
> [snip]
>> Correct, the way XWin is started using startxwin.bat does make the
>> whole server execution depend on the xterm, so when the xterm is
>> closed XWin terminates. 

This is not true.  It's startx (or rather, xinit) that closes the 
server on exit.  You can safely remove the xterm line from startxwin.bat
(or startxwin.sh) and the server just keeps going.

>> That can be changed easily by using startx (instead of startxwin.bat)
>> and creating a file in your home directory named .xsession like this:
>> 
>> #!/bin/sh
>> #
>> # FILE: $HOME/.xsession
>> 
>> # exec SylpheedClaws
>> 
>> /usr/bin/sylpheed-claws & scpid=$!
>> 
>> # Now wait for program to terminate
>> 
>> wait $scpid
>> exit 0
> 
> I try it. The only thing is that if SC is close the Xserver close too.

That's to be expected.

>>> What I try to get is one script where I can start a Xserver without
>>> any bash "window" and SC.
> 
> Again to start this I have to start a cygwin bash shell. I like to
> start SC without a shell 

Your problem is that you're using xinit via startx.  The last command 
executed is intended to be a window manager.  It is designed so that 
when the window manager dies, X is shut down.  This is (usually) what 
one wants.  Unfortunately for users of startx, XWin by default uses its 
built-in window manager, so in order to keep X alive some other process 
must be started.  An xterm was chosen IIRC because most users will want 
a shell at some point in their session.

If you use startxwin.* to start X instead, you'll find it doesn't 
require any process to hang around.  The distributed files start an 
xterm, but you can safely remove that line.

Please don't be tempted to try hacking startxwin.* to start sylpheed.
It's bad practice to use a server initialisation script to start client
programs.  I would guess that at least half of the "fault reports" on 
this list are from people who try to use startx* to run xterm, then
complain that they get a duplicate invocation error.

It's much better to use startxwin.bat to start XWin once (you can put a
shortcut to startxwin.bat in your Windows startup folder), then have a
shortcut to start your client programs such as sylpheed.

If you want to start sylpheed without explicitly starting XWin, you can 
write a small script to use checkx to see if the server is running and
if it isn't, start it.

E.g.

--------------- /tmp/xdemo.sh -----------------
#!/bin/bash
export DISPLAY=:0
/usr/bin/checkx || /usr/X11R6/bin/startxwin.sh
exec /usr/X11R6/bin/xeyes
----------------------------------------------

You can then run this script from a shortcut where the target is:

C:\cygwin\bin\run.exe /bin/bash -c /tmp/xdemo.sh

You would need to remove the line from startxwin.sh that starts xterm,
which means you should really use a copy of it, otherwise the next 
time you update X, you'd be likely to lose your change.

HTH

Phil
-- 

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the H.E Information Systems Ltd. 
Tel:    0161 866 9066
Web:  www.heis.co.uk

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.clearswift.com
**********************************************************************


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


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