LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Multiple Gnome Sessions (https://www.linuxquestions.org/questions/linux-software-2/multiple-gnome-sessions-100258/)

Ocaba 10-04-2003 04:35 PM

Multiple Gnome Sessions
 
Hi, even though I'm still a fairly new user, I've tried to mess around with the configuration files as much as I can. Well, being a sucker for the sheer power of Linux and the highly customizable GUI and window managers, I've tried to get it to look as awesome as posible. Bad thing is that I usually like changing looks every now and then.

Say I have two different WMs, like Metacity and Enlightenment, is it possible for me to have two different Gnome sessions to choose at login, each with different cofigurations (WMs, desktop background, panels)? If it is, how can I? I've been reading tons of documentation but I can't find how to make two completely different sessions for just one user.

If you can help me, please do so.

EDIT: Oh yeah, RedHat 9, GNOME 2.2.2

jailbait 10-04-2003 04:57 PM

"is it possible for me to have two different Gnome sessions to choose at login, each with different cofigurations"

Gnome keeps all of its settings in /home/user/.gnome or perhaps /home/user/.gnome2. If you rename /home/user/.gnome2 to something else, say /home/user/.spareoldgnome2 then the next time you login as user Gnome will build a whole new /home/user/.gnome2 tree just like it does on the first login after an install. You can configure your new gnome settings to be your second gnome session.

The only way that I can think of to switch between the two Gnome sessions is to rename directories before you log in as user. This could be awkward if done by hand.

Or you could put two different session names on the GDM login screen. Then you could change /home/user/.xinitrc so that it deleted /home/user/.gnome2 and then copied the proper spare .gnome2 to /home/user/.gnome2 before starting Gnome.


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Ocaba 10-04-2003 07:18 PM

Ugh, so awkward...

Is there any other way to do that? Or how could one find/write a script or something to do it (I have very limited experience)?

Please, thanks in advanced.

jailbait 10-04-2003 08:34 PM

"Is there any other way to do that?"

Another way to accomplish more or less the same objective would be to set up two different users, each with a different Gnome desktop. Then put the users in the same group and share all of their data files between them. That way you could log in as either user and manipulate the same data.

"Or how could one find/write a script or something to do it"

You could set up a user with two /home/user/.gnome2 files, say /home/user/hansel and /home/user/gretel. Then create the following hansel and gretel scripts:

rm /home/user/.gnome2/* -R
cp /home/user/hansel/* /home/user/.gnome2 -R
startx

rm /home/user/.gnome2/* -R
cp /home/user/gretel/* /home/user/.gnome2 -R
startx


Then when you log in you can either login to gnome or login to bash. When you login to bash you then either start hansel or gretal. Logging in to gnome2 will start whichever .gnome you used last without the overhead of the copy.

I personally would use the .xinitrc method with the addition of the idea that selecting gnome at GDM will login to the current .gnome2 without copying anything.


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Ocaba 10-04-2003 09:31 PM

Alright, I made two different sessions for the GDM login screen by adding scripts to /etc/X11/gdm/Sessions. My .xinitrc doesn't do anything, that's right, it doesn't excute anything, but I'm probably wrong. So what should I include in the session scripts? 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.

jailbait 10-05-2003 10:06 AM

Changing startx
 
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

Ocaba 10-05-2003 12:16 PM

Alright, I did it a different way, but that's expectable.

I looked around and as I told you scripts in /etc/X11/gdm/Sessions were the different sessions I could choose at login, so I did the following:

I made two hidden folders in my /home/user/, .settingsM and .settingsE and I copied .gnome2 to each of them. Then I made two new session scripts like this:

Enlightenment (GNOME)

#! /bin/bash
ln -sf /home/user/.settingsE/.gnome2 /home/user/
exec /etc/X11/xdm/Xsession gnome

Metacity (GNOME)

#! /bin/bash
ln -sf /home/user/.settingsM/.gnome2 /home/user/
exec /etc/X11/xdm/Xsession gnome

It worked, depending on the session I choose it links the correct settings. And since it's a link it saves changes too. Now all I have to figure out is how to make session dependant backgrounds...how does GNOME chooses its backgrounds?

jailbait 10-05-2003 12:44 PM

"It worked"

Way to go.


"how does GNOME chooses its backgrounds?"

Right click on a blank area of the desktop. Click on Change Desktop Background.


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Ocaba 10-05-2003 12:52 PM

:D Hehehehehe, not that...I mean where does it store the path to the picture it is currently using as background?

jailbait 10-05-2003 02:31 PM

"where does it store the path to the picture it is currently using as background?"

On my system it is at:

/home/user/.gconf/desktop/gnome/background/%gconf.xml




___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites


All times are GMT -5. The time now is 06:02 PM.