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: Various starting X problems


On  1 Apr, Igor Pechtchanski wrote:
>  How about the "macro replace in a postinstall script" approach I suggested 
>  earlier?  Also, postinstall scripts already run *in* Cygwin, so there 
>  should be no reason to detect it, right?  Just use "cygpath"... 
>   
>  > > If you'd be interested in a unified approach, where the .bat just runs 
>  > > bash -c startxwin.sh (which will probably in turn be just a wrapper for 
>  > > startx) I might be able to make time for this. 
>  > 
>  > Yes, I think that may be the way to go at this point since we are 
>  > starting to waste a lot of cycles trying to do things in batch files 
>  > that are easily supported in shell scripts using *nix-style utilities. 
>   
>  Perhaps you're right.  As long as you run "bash --login -c ...", so that 
>  the PATH is set properly. 

That's what I do as part of my post-install.  Here's the generic
startx.bat:

    rem     The D: gets replaced by the real Cygwin drive during installation:
    D:

    chdir \cygwin\bin

    rem     For use with sample .profile: stop the exec in user's .profile for the
    rem     case where we're really starting the X server.
    set STARTX=df

    rem     bash --login -c "PATH=$PATH:/usr/X11R6/bin; startx"
            bash --login -c "PATH=$PATH:/usr/X11R6/bin; startx -- -multiwindow"
    rem     bash --login -c "PATH=$PATH:/usr/X11R6/bin; startx -- -rootless"

With this line from my 345 line post-install script:

sed "s/^D:/$CYGDRIVE:/;s/\\cygwin/$CYGDIR/" startx.bat > /startx.bat
chmod 777 /startx.bat

I learned many years ago that writing Windows .bat scripts is like
typing with your nose.  There's a certain satisfaction at getting a
result, but you work a lot harder.  My rule of thumb was about 10 times
the effort of writing a shell script goes into writing a .bat script.

luke


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