Cygwin XFree86 startx Problem

Igor Pechtchanski pechtcha@cs.nyu.edu
Thu Nov 20 17:30:00 GMT 2003


On Thu, 20 Nov 2003, Chan Seng Loong wrote:

> hi...
>
> I having problem using startx to startx the X window
> or X server.......
>
> here are the error:
>
> Chan Seng Loong@amd1500mhz ~
> $ startx
> + userclientrc=/home/Chan Seng Loong/.xinitrc
> + userserverrc=/home/Chan Seng Loong/.xserverrc
> + sysclientrc=/usr/X11R6/lib/X11/xinit/xinitrc
> + sysserverrc=/usr/X11R6/lib/X11/xinit/xserverrc
> + defaultclient=/usr/X11R6/bin/xterm
> + defaultserver=/usr/X11R6/bin/X
> + defaultclientargs=
> + defaultserverargs=
> + clientargs=
> + serverargs=
> + [ -f /home/Chan Seng Loong/.xinitrc ]
> [: Seng: unknown operand
> + [ -f /usr/X11R6/lib/X11/xinit/xinitrc ]
> + defaultclientargs=/usr/X11R6/lib/X11/xinit/xinitrc
> + [ -f /home/Chan Seng Loong/.xserverrc ]
> [: Seng: unknown operand
> + [ -f /usr/X11R6/lib/X11/xinit/xserverrc ]
> + whoseargs=client
> + [ x != x ]
> + [ x = x ]
> + [ x = x ]
> + client=/usr/X11R6/lib/X11/xinit/xinitrc
> + [ x = x ]
> + [ x = x -a x = x ]
> + server=
> + [ x = x ]
> + XAUTHORITY=/home/Chan Seng Loong/.Xauthority
> + export XAUTHORITY
> + removelist=
> + xinit /usr/X11R6/lib/X11/xinit/xinitrc --
>
> + userresources=/home/Chan Seng Loong/.Xresources
> + usermodmap=/home/Chan Seng Loong/.Xmodmap
> + sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
> + sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
> + [ -f /usr/X11R6/lib/X11/xinit/.Xresources ]
> + [ -f /usr/X11R6/lib/X11/xinit/.Xmodmap ]
> + [ -f /home/Chan Seng Loong/.Xresources ]
> [: Seng: unknown operand
> + [ -f /home/Chan Seng Loong/.Xmodmap ]
> [: Seng: unknown operand
> + twm
> + xclock -geometry 50x50-1+1
> + xterm -geometry 80x50+494+51
> + xterm -geometry 80x20+494-0
> + exec xterm -geometry 80x66+0+0 -name login
> Fontconfig error: Cannot load default config file
> Warning: Cannot convert string "" to type XftFont
>
> I tried to fix the probelm using the XF86Config and .xinitrc file.....
> but failed.....
>
> Can someone help me to solve the problem......?
>
> Thanks
> John

John,

Your username (and, consequently, your home directory) has spaces in it.
The startx script is not space-in-filename friendly (missing quotes), and
thus some parts of it don't run correctly.  Below is a patch to the startx
script that should make it work with home dirs containing spaces
(untested).  Please save the attached patch as /tmp/startx.patch and run
'cd /usr/X11R6/bin && patch -p0 < /tmp/startx.patch'.  You should then be
able to use the script.

Harold, this patch is against /usr/X11R6/bin/startx from
XFree86-bin-4.3.0-7 (CVS revision "XFree86: startx.cpp 3.16"). I have a
feeling this file is auto-generated (haven't looked at the build process).
I don't know if you can incorporate this patch as-is as Cygwin-specific,
or if you need a patch to the original source, startx.cpp (either for
Cygwin or to send upstream).  Let me know either way, and I'll either
create a ChangeLog for this patch, or create one against the CVS source.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton
-------------- next part --------------
--- startx-orig	2003-10-28 12:10:43.000000000 -0500
+++ startx	2003-11-20 12:11:31.068496000 -0500
@@ -14,8 +14,8 @@
 # $XFree86: xc/programs/xinit/startx.cpp,v 3.16 2003/01/24 21:30:02 herrb Exp $
 
 
-userclientrc=$HOME/.xinitrc
-userserverrc=$HOME/.xserverrc
+userclientrc="$HOME/.xinitrc"
+userserverrc="$HOME/.xserverrc"
 sysclientrc=/usr/X11R6/lib/X11/xinit/xinitrc
 sysserverrc=/usr/X11R6/lib/X11/xinit/xserverrc
 defaultclient=/usr/X11R6/bin/xterm
@@ -30,19 +30,16 @@ serverargs=""
 
 
 
-if [ -f $userclientrc ]; then
-    defaultclientargs=$userclientrc
-elif [ -f $sysclientrc ]; then
-    defaultclientargs=$sysclientrc
+if [ -f "$userclientrc" ]; then
+    defaultclientargs="\"$userclientrc\""
+elif [ -f "$sysclientrc" ]; then
+    defaultclientargs="\"$sysclientrc\""
 fi
 
-
-
-
-if [ -f $userserverrc ]; then
-    defaultserverargs=$userserverrc
-elif [ -f $sysserverrc ]; then
-    defaultserverargs=$sysserverrc
+if [ -f "$userserverrc" ]; then
+    defaultserverargs="\"$userserverrc\""
+elif [ -f "$sysserverrc" ]; then
+    defaultserverargs="\"$sysserverrc\""
 fi
 
 whoseargs="client"
@@ -52,15 +49,15 @@ while [ x"$1" != x ]; do
     /''*|\./''*)
 	if [ "$whoseargs" = "client" ]; then
 	    if [ x"$clientargs" = x ]; then
-		client="$1"
+		client="\"$1\""
 	    else
-		clientargs="$clientargs $1"
+		clientargs="$clientargs \"$1\""
 	    fi
 	else
 	    if [ x"$serverargs" = x ]; then
-		server="$1"
+		server="\"$1\""
 	    else
-		serverargs="$serverargs $1"
+		serverargs="$serverargs \"$1\""
 	    fi
 	fi
 	;;
@@ -69,14 +66,15 @@ while [ x"$1" != x ]; do
 	;;
     *)
 	if [ "$whoseargs" = "client" ]; then
-	    clientargs="$clientargs $1"
+	    clientargs="$clientargs \"$1\""
 	else
 	    # display must be the FIRST server argument
-	    if [ x"$serverargs" = x ] && 		 expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then
+	    if [ x"$serverargs" = x ] && \
+		 expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then
 
-		display="$1"
+		display="\"$1\""
 	    else
-		serverargs="$serverargs $1"
+		serverargs="$serverargs \"$1\""
 	    fi
 	fi
 	;;
@@ -90,7 +88,7 @@ if [ x"$client" = x ]; then
     if [ x"$clientargs" = x ]; then
 	client="$defaultclientargs"
     else
-	client=$defaultclient
+	client="$defaultclient"
     fi
 fi
 
@@ -100,39 +98,26 @@ if [ x"$server" = x ]; then
     if [ x"$serverargs" = x -a x"$display" = x ]; then
 	server="$defaultserverargs"
     else
-	server=$defaultserver
+	server="$defaultserver"
     fi
 fi
 
 if [ x"$XAUTHORITY" = x ]; then
-    XAUTHORITY=$HOME/.Xauthority
+    XAUTHORITY="$HOME/.Xauthority"
     export XAUTHORITY
 fi
 
 removelist=
 
+#xinit $client $clientargs -- $server $display $serverargs
 
-xinit $client $clientargs -- $server $display $serverargs
+# correctly process quotes, etc
+eval "set -- $client $clientargs -- $server $display $serverargs"
+
+xinit "$@"
 
 if [ x"$removelist" != x ]; then
+    # Note: this is still not space-friendly!
     xauth remove $removelist
 fi
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-


More information about the Cygwin-xfree mailing list