This is the mail archive of the cygwin-xfree@cygwin.com 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: get rid of dos window?


Armin Hartinger wrote:
> Anyway, to the point: I want to just throw a
> batch-file into the windows-startup folder,
> which starts up the X-server and subsequently,
> their Gnome-desktop starts up automatically.
> I'm almost there, but is there no way to get
> rid of the DOS-window which accompanies the
> X-server application?

For what it's worth, I find the following works very well indeed for
me. Some small variant of it will probably solve your problem.(I'm
using the Test53 server, but I would expect this to work with any
version.)

1) Write a shell script that redirects stdin/stdout/stderr before
starting the X server in the background. For example, I'm using the
following (you'll want different arguments to
the server):

  #!/bin/bash
  exec 0< /dev/null
  exec 1> ~/.xdmcp-errors
  exec 2>& 1
  X :0 -screen 0 1024 768 -xkbmap gb -nowinkill -broadcast -once &

2) Run that shell script in the background from a suitable Windows
shortcut. I run the above from a "run minimized" shortcut whose
target is:

    C:\cygwin\bin\bash.exe --login -c "~/bin/start-xdmcp&"

(where "~/bin/start-xdmcp" is the POSIX path of the shell script).

The DOS window appears only for as long as it takes bash to start up
and fork off the background process, and because it's minimized, I
usually don't even notice it. (I use a similar shortcut on the
Windows taskbar to launch rxvt -- no ugly console windows for me!)

3) I have found that this (sometimes?) does not work when the CYGWIN
environment variable includes "tty". (I think I sort of understand
why, but I haven't looked at it carefully.)
So I use CYGWIN="binmode ntsec".

Regards,
Andrew.


=====
Andrew McRae  <anm@pobox.com>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


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