xinitrc follies

Carla Schroder <[email protected]>
Newsgroups gmane.org.user-groups.linux.pdxlug
Message-ID <[email protected]>
hi gang,

I'm trying to configure .xinitrc so I can choose which window manager to use 
on a whim, and of course there must be a default. Here is my current version:

#!/bin/sh

ARG=$1
DEFAULTWM="afterstep"

if [ ! $ARG ]; then
    ARG=$DEFAULTWM
fi

if [ $ARG = "gnome" ];then
   WM=gnome-session
elif [ $ARG = "kde" ];then
   WM=startkde
elif [ $ARG = "after" ];then
   WM=afterstep
else
   WM=$DEFAULTWM
fi

exec $WM

Running 'startx' launches the default. But when I try 'startx gnome' or 
'startx kde', it looks like X starts, then closes right away. Anything I use 
as DEFAULTWM works. Any brilliant notions?

thanks!

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Carla Schroder
this message brought to you
by Libranet 2.8 and Kmail
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.