diff options
-rw-r--r-- | startx.cpp | 66 | ||||
-rw-r--r-- | xinitrc.cpp | 62 |
2 files changed, 99 insertions, 29 deletions
@@ -1,4 +1,4 @@ -XCOMM!/bin/sh +XCOMM!SHELL_CMD XCOMM $Xorg: startx.cpp,v 1.3 2000/08/17 19:54:29 cpqbld Exp $ XCOMM @@ -13,28 +13,36 @@ XCOMM Site administrators are STRONGLY urged to write nicer versions. XCOMM XCOMM $XFree86: xc/programs/xinit/startx.cpp,v 3.16tsi Exp $ -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) XCOMM Check for /usr/bin/X11 and BINDIR in the path, if not add them. XCOMM This allows startx to be placed in a place like /usr/bin or /usr/local/bin -XCOMM and people may use X without changing their PATH +XCOMM and people may use X without changing their PATH. +XCOMM Note that we put our own bin directory at the front of the path, and +XCOMM the standard SCO path at the back, since if you are using the Xorg +XCOMM server theres a prett good chance you want to bias the Xorg clients +XCOMM over the old SCO X11R5 clients. XCOMM First our compiled path bindir=BINDIR -if expr $PATH : ".*`echo $bindir | sed 's?/?\\/?g'`.*" > /dev/null 2>&1; then - : -else - PATH=$PATH:BINDIR -fi + +case $PATH in + *:$bindir | *:$bindir:* | $bindir:*) ;; + *) PATH=$bindir:$PATH ;; +esac XCOMM Now the "SCO" compiled path +scobindir=/usr/bin/X11 -if expr $PATH : '.*\/usr\/bin\/X11.*' > /dev/null 2>&1; then - : -else - PATH=$PATH:/usr/bin/X11 -fi +case $PATH in + *:$scobindir | *:$scobindir:* | $scobindir:*) ;; + *) PATH=$PATH:$scobindir ;; +esac + +XCOMM Bourne shell doesn't automatically export modified environment variables +XCOMM so export the new PATH just in case the user changes the shell +export PATH XCOMM Set up the XMERGE env var so that dos merge is happy under X @@ -59,7 +67,7 @@ defaultserverargs="" clientargs="" serverargs="" -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) if [ -f $scoclientrc ]; then defaultclientargs=$scoclientrc else @@ -69,8 +77,20 @@ if [ -f $userclientrc ]; then elif [ -f $sysclientrc ]; then defaultclientargs=$sysclientrc fi -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) fi + +XCOMM SCO -t option: do not start an X server +case $1 in + -t) if [ -n "$DISPLAY" ]; then + REMOTE_SERVER=TRUE + shift + else + echo "DISPLAY environment variable not set" + exit 1 + fi + ;; +esac #endif if [ -f $userserverrc ]; then @@ -175,10 +195,10 @@ XCOMM now add the same credentials to the client authority file XCOMM if '$displayname' already exists don't overwrite it as another XCOMM server man need it. Add them to the '$xserverauthfile' instead. for displayname in $authdisplay $hostname$authdisplay; do - authcookie=`xauth list "$displayname" @@ + authcookie=`BINDIR/xauth list "$displayname" @@ | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; if [ "z${authcookie}" == "z" ] ; then - xauth -q << EOF + BINDIR/xauth -q << EOF add $displayname . $mcookie EOF removelist="$displayname $removelist" @@ -192,10 +212,18 @@ done #endif -xinit $client $clientargs -- $server $display $serverargs +#if defined(__SCO__) || defined(__UNIXWARE__) +if [ "$REMOTE_SERVER" = "TRUE" ]; then + exec /bin/sh ${client} +else + BINDIR/xinit $client $clientargs -- $server $display $serverargs +fi +#else +BINDIR/xinit $client $clientargs -- $server $display $serverargs +#endif if [ x"$removelist" != x ]; then - xauth remove $removelist + BINDIR/xauth remove $removelist fi if [ x"$xserverauthfile" != x ]; then rm -f $xserverauthfile diff --git a/xinitrc.cpp b/xinitrc.cpp index 641eede..a145d7e 100644 --- a/xinitrc.cpp +++ b/xinitrc.cpp @@ -1,4 +1,4 @@ -XCOMM!/bin/sh +XCOMM!SHELL_CMD XCOMM $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $ userresources=$HOME/.Xresources @@ -9,25 +9,67 @@ sysmodmap=XINITDIR/.Xmodmap XCOMM merge in defaults and keymaps if [ -f $sysresources ]; then - xrdb -merge $sysresources + BINDIR/xrdb -merge $sysresources fi if [ -f $sysmodmap ]; then - xmodmap $sysmodmap + BINDIR/xmodmap $sysmodmap fi if [ -f $userresources ]; then - xrdb -merge $userresources + BINDIR/xrdb -merge $userresources fi if [ -f $usermodmap ]; then - xmodmap $usermodmap + BINDIR/xmodmap $usermodmap fi XCOMM start some nice programs -twm & -xclock -geometry 50x50-1+1 & -xterm -geometry 80x50+494+51 & -xterm -geometry 80x20+494-0 & -exec xterm -geometry 80x66+0+0 -name login +#if defined(__SCO__) || defined(__UNIXWARE__) +if [ -r /etc/default/xdesktops ]; then + . /etc/default/xdesktops +fi + +if [ -r $HOME/.x11rc ]; then + . $HOME/.x11rc +else + if [ -r /etc/default/X11 ]; then + . /etc/default/X11 + fi +fi + +#if defined(__SCO__) +if [ -n "$XSESSION" ]; then + case "$XSESSION" in + [Yy][Ee][Ss]) + [ -x /usr/bin/X11/scosession ] && exec /usr/bin/X11/scosession + ;; + esac +fi + +if [ -n "$XDESKTOP" ]; then + exec `eval echo $"$XDESKTOP"` +else + if [ -x /usr/bin/X11/pmwm -a -x /usr/bin/X11/scoterm ]; then + /usr/bin/X11/scoterm 2> /dev/null & + exec /usr/bin/X11/pmwm 2> /dev/null + fi +fi +#elif defined(__UNIXWARE__) +if [ -n "$XDESKTOP" ]; then + exec `eval echo $"$XDESKTOP"` +else + if [ -x /usr/X/bin/pmwm ]; then + exec /usr/X/bin/pmwm 2> /dev/null + fi +fi +#endif + +XCOMM This is the fallback case if nothing else is executed above +#endif /* !defined(__SCO__) && !defined(__UNIXWARE__) */ +BINDIR/twm & +BINDIR/xclock -geometry 50x50-1+1 & +BINDIR/xterm -geometry 80x50+494+51 & +BINDIR/xterm -geometry 80x20+494-0 & +exec BINDIR/xterm -geometry 80x66+0+0 -name login |