RE: Starting Xwin - Shell Window Remains

2005-08-16 Thread Baksik, Frederick (NM75)
 
 Hi,
 
 I'm able to start and use Xwin.  However, after the X server 
 is up, I need to manually close the cygwin bash window (the 
 one that started the X server).  I've checked the usual 
 places, but have not come up with a solution.
 
 This is probably more of a shell scripting question, but 
 since the solution I'm looking for is a windows executable 
 (C:\cygwin\startxwin.bat) that I can drop into my StartUp 
 folder to automatically start Xwin when I log in, here I am.
 
 Here's where I'm at thus far:
 
 1.  C:\cygwin\startxwin.bat exists, and has the following contents:  
 
 @echo off
 
 c:
 chdir c:\cygwin\bin
 
 bash --login -i /usr/local/bin/myxwin
 
 2.  /usr/local/bin/myxwin exists, and has the following contents:
 
 #!/usr/bin/bash
 #
 # Start the Cygwin X server, xwin
 
 echo Starting X server...
 
 # Succeeds, but must kill cygwin bash window manually nohup 
 xwin -multiwindow -clipboard -emulate3buttons /dev/null 21 
 
 # Same as previous
 #(nohup xwin -multiwindow -clipboard -emulate3buttons 
 /dev/null 21 )  exit
 
 # Same as previous
 #exec $(nohup xwin -multiwindow -clipboard -emulate3buttons 
 /dev/null 21 )
 
 # have tried permutations of the above commands, without success.
 # odd, can't seem to find fork in cygwin.  errors occur, so 
 it's not a shell builtin.
 
 echo You can safely close this window
 
 # Also doesn't work - the PID no longer exists #kill -9 $$
 
 --
 Thanks in advance,
 -Brett

With the Cygwin/X X-startup-scripts-1.0.10-4 package the following batch
files were included:
C:\cygwin\usr\X11R6\bin\startxwin.bat
C:\cygwin\usr\X11R6\bin\startxdmcp.bat -- for XDMCP with another host

Both of these start Xwin and there is no cygwin bash window to close.
Note that the xstartxwin.bat file after starting Xwin also starts an Xterm.
The batch could be modified to not start the Xterm.

Apparently it has something to do with C:\cygwin\usr\X11R6\bin\run.exe, but
I couldn't find much on this executable.

--
Frodak

--
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: Starting Xwin - Shell Window Remains

2005-08-15 Thread Doug VanLeuven

brett lee wrote:

Hi,

I'm able to start and use Xwin.  However, after the X server is up, I need to 
manually close the
cygwin bash window (the one that started the X server).  I've checked the usual 
places, but have
not come up with a solution.

This is probably more of a shell scripting question, but since the solution 
I'm looking for is a
windows executable (C:\cygwin\startxwin.bat) that I can drop into my StartUp 
folder to
automatically start Xwin when I log in, here I am.

Here's where I'm at thus far:

1.  C:\cygwin\startxwin.bat exists, and has the following contents:  


@echo off

c:
chdir c:\cygwin\bin

bash --login -i /usr/local/bin/myxwin


You might want to try this:

bash --login -c /usr/local/bin/myxwin
 ^^

-i is for an interactive shell

Regards, Doug

--
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: Starting Xwin - Shell Window Remains

2005-08-15 Thread Doug VanLeuven

brett lee wrote:
1.  C:\cygwin\startxwin.bat exists, and has the following contents:  


@echo off

c:
chdir c:\cygwin\bin

bash --login -i /usr/local/bin/myxwin


bash --login -c /usr/local/bin/myxwin


2.  /usr/local/bin/myxwin exists, and has the following contents:

#!/usr/bin/bash
#
# Start the Cygwin X server, xwin

echo Starting X server...

# Succeeds, but must kill cygwin bash window manually
nohup xwin -multiwindow -clipboard -emulate3buttons /dev/null 21 


xwin -multiwindow -clipboard -emulate3buttons -silent-dup-error 

I don't really know about the silent-dup-error but it is in the example
script, so I use it.
I use this very technique so my xwin is launched with environment
variables set the way I want, without maintaining a seperate set of batch
commands, and I don't have a left over window - but there is a residual
process reported.  I presume the parent.

Regards, Doug

--
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: Starting Xwin - Shell Window Remains

2005-08-15 Thread Reid Thompson

As info
I start X by
   using a shortcut to open an rxvt window running bash ( see below for 
contents of shortcut  scripts ). 
   (If you do not have rxvt, use setup to get it, it is 
unbelievable to me that with billions of dollars MS cannot include a 
decent command prompt.)

   Then, in the rxvt window I type
  startxscript 

After this I can exit the rxvt window used to start X with no problems.

I have a desktop shortcut that has a target of:

C:\cygwin\bin\rxvt.exe -sr -sl 2500  -geometry 80x25 -sb -fg grey -bg 
grey15 -fn lucida console-13-bold -e c:/cygwin/bin/bash --rcfile 
/home/rthompso/.bashrc


and a start in value of:

c:\cygwin\home\rthompso

$HOME/bin is part of my path.
I have $HOME/bin/startxscript that contains:

$ cat startxscript
#!/bin/bash
/usr/X11R6/bin/startxwin.sh

My /usr/X11R6/bin/startxwin.sh contains ( slight mods from the 
downloaded script ):


#! /bin/sh
export DISPLAY=127.0.0.1:0.0
export PATH=/usr/X11R6/bin:$PATH
export XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
export XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
export XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
export XNLSPATH=/usr/X11R6/lib/X11/locale

# Cleanup from last run.
rm -rf /tmp/.X11-unix


# The error Fatal server error: could not open default font 'fixed' is
# caused by using a DOS mode mount for the mount that the Cygwin/X
# fonts are accessed through.  See the Cygwin/X FAQ for more
# information:
# http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-error-font-eof


# Brief descriptions of XWin-specific options:
#
# -screen scr_num [width height]
#  Enable screen scr_num and optionally specify a width and
#  height for that screen.
#  Most importantly, any parameters specified before the first -screen
#  parameter apply to all screens.  Any options after the first -screen
#  parameter apply only to the screen that precedes the parameter.
#  Example:
#  XWin -fullscreen -screen 0 -screen 1 -depth 8 -screen 2
#  All screens will be fullscreen, but screen 2 will be depth 8, while
#  screens 0 and 1 will be the default depth (whatever depth Windows
#  is currently running at).
# -multiwindow
#  Start an integrated Windows-based window manager.  Not to be used
#  with -rootless nor -fullscreen.
# -rootless
#  Use a transparent root window with an external window manager
#  (such as twm).  Not to be used with -multiwindow nor
#  with -fullscreen.
# -fullscreen
#  Use a window as large as possible on the primary monitor.
# -multiplemonitors
#  Create a root window that covers all monitors on a
#  system with multiple monitors.
# -clipboard
#  Enable the integrated version of xwinclip.  Do not use in
#  conjunction with the xwinclip program.
# -depth bits_per_pixel
#  Specify the screen depth to run at (in bits per pixel) using a
#  DirectDraw-based engine in conjunction with the -fullscreen
#  option, ignored if the -fullscreen option is not specified.
#  By default, you will be using a DirectDraw based engine on any
#  system that supports it.
# -unixkill
#  Trap Ctrl+Alt+Backspace as a server shutdown key combination.
# -nounixkill
#  Disable Ctrl+Alt+Backspace as a server shutdown key combination 
(default).

#  Example:
#  XWin -unixkill -screen 0 -screen 1 -screen 2 -nounixkill
#  Screens 0 and 1 will allow Ctrl+Alt+Backspace, but screen 2 will not.
# -winkill
#  Trap Alt+F4 as a server shutdown key combination (default).
# -nowinkill
#  Disable Alt+F4 as a server shutdown key combination.
# -scrollbars
#  Enable resizing of the server display window.  Do not use in 
conjunction

#  with -multiwindow nor with -rootless.
# -nodecoration
#  Draw the server root window without a title bar or border.
#  Do not use with -mutliwindow nor with -rootless.
# -lesspointer
#  Hide the Windows mouse cursor anytime it is over any part of the
#  window, even if Cygwin/X is not the window with the focus.
# -refresh rate_in_Hz
#  Specify a refresh rate to use when used with the -fullscreen option.
# -trayicon
#  Enable the tray icon (default).
# -notrayicon
#  Disable the tray icon.
#  Example:
#  XWin -notrayicon -screen 0 -screen 1 -screen 2 -trayicon
#  Screens 0 and 1 will not have tray icons, but screen 2 will.
# -emulate3buttons [timeout]
#  Emulate 3 button mouse with an optional timeout in milliseconds.
# -xf86config
#  Specify an XF86Config-style configuration file.
# -keyboard
#  Specify a keyboard device from the configuration file.


#
# Startup the programs
#


# Startup the X Server with the integrated Windows-based window manager.
# WARNING: Do not use 'xwinclip' in conjunction with the ``-clipboard''
# command-line parameter for XWin.  Doing so would start two clipboard
# managers, which is never supposed to happen.

XWin -multiwindow -clipboard -silent-dup-error 


# Startup an xterm, using bash as the shell.


Starting Xwin - Shell Window Remains

2005-08-14 Thread brett lee
Hi,

I'm able to start and use Xwin.  However, after the X server is up, I need to 
manually close the
cygwin bash window (the one that started the X server).  I've checked the usual 
places, but have
not come up with a solution.

This is probably more of a shell scripting question, but since the solution 
I'm looking for is a
windows executable (C:\cygwin\startxwin.bat) that I can drop into my StartUp 
folder to
automatically start Xwin when I log in, here I am.

Here's where I'm at thus far:

1.  C:\cygwin\startxwin.bat exists, and has the following contents:  

@echo off

c:
chdir c:\cygwin\bin

bash --login -i /usr/local/bin/myxwin

2.  /usr/local/bin/myxwin exists, and has the following contents:

#!/usr/bin/bash
#
# Start the Cygwin X server, xwin

echo Starting X server...

# Succeeds, but must kill cygwin bash window manually
nohup xwin -multiwindow -clipboard -emulate3buttons /dev/null 21 

# Same as previous
#(nohup xwin -multiwindow -clipboard -emulate3buttons /dev/null 21 )  exit

# Same as previous
#exec $(nohup xwin -multiwindow -clipboard -emulate3buttons /dev/null 21 )

# have tried permutations of the above commands, without success.
# odd, can't seem to find fork in cygwin.  errors occur, so it's not a shell 
builtin.

echo You can safely close this window

# Also doesn't work - the PID no longer exists
#kill -9 $$

--
Thanks in advance,
-Brett

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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/