I began to put some serious thought into your problem instead of just answering off the top of my head and my answer has become more complex. I am calling your two versions of .gnome hansel and gretel so they can't possible be confused with any Linux variables or scripts. Similarly I am assuming that you add hansel and gretal to your GDM list of session types.
" My .xinitrc doesn't do anything"
The scripts for .xinitrc, startx, etc. are written by the distributor so they are highly distribution dependent. In SuSE the way that Gnome or KDE is started is that the WINDOWMANAGER variable is set to the complete path name of the window manager to be started. Then the last two commands in /home/user/.xinitrc are:
exec $WINDOWMANAGER
exit 0
In SuSE the process of setting $WINDOWMANAGER starts with the startx script and wanders through several scripts before .xinitrc finally starts the WINDOWMANAGER that the committee of scripts has decided to start. On SuSE, startx is at /etc/X11R6/bin/startx In SuSE, GDM passes startx the name of the requested window manager in a variable called WM.
So you need to put your new code ahead of any of the Red Hat code that begins to define the Red Hat equivalent of SuSE WINDOWMANAGER. So I think that your new script should go at the beginning of startx .
" The copying and overwriting of .gnome seems ok but how can I script that? I'm practically asking if normal commands work in scripts or if they have a different format."
Commands work the same in scripts as from the command line. You will have to delete .gnome before you copy over it. Otherwise you will end up with .gnome being a composite of hansel and gretel.
Then the following script should work at the beginning of the SuSE startx script.
# check for hansel
if test "$WM" = hansel;
then
WM=gnome
rm /home/user/.gnome/* -R
cp /home/user/hansel/* /home/user/.gnome -R
fi
# check for gretel
if test "$WM" = gretel;
then
WM=gnome
rm /home/user/.gnome/* -R
cp /home/user/gretel/* /home/user/.gnome -R
fi
So getting back to the problem that your .xinitrc does nothing; you might be able to solve the whole problem within startx if you can figure out the variable name used to pass your GDM session selection to startx.
The last problem is adding hansel and gretel to the list of session types in GDM. I know how to do this in KDM but not in GDM so I am of little help on that problem. I am guessing that it is set in a file called gdmrc which is probably located in /etc or /opt.
___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html
Steve Stites