LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-04-2003, 04:35 PM   #1
Ocaba
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Rep: Reputation: 0
Unhappy 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

Last edited by Ocaba; 10-04-2003 at 04:37 PM.
 
Old 10-04-2003, 04:57 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"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
 
Old 10-04-2003, 07:18 PM   #3
Ocaba
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
Old 10-04-2003, 08:34 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"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

Last edited by jailbait; 10-04-2003 at 08:36 PM.
 
Old 10-04-2003, 09:31 PM   #5
Ocaba
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
Old 10-05-2003, 10:06 AM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
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
 
Old 10-05-2003, 12:16 PM   #7
Ocaba
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 10-05-2003, 12:44 PM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"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
 
Old 10-05-2003, 12:52 PM   #9
Ocaba
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Hehehehehe, not that...I mean where does it store the path to the picture it is currently using as background?
 
Old 10-05-2003, 02:31 PM   #10
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple gnome sessions? Swinstead Linux - Newbie 3 11-29-2005 08:54 AM
close multiple sessions htamayo Linux - Software 1 01-07-2005 02:42 PM
Multiple Sessions? ttague Linux - Newbie 4 01-02-2005 10:00 AM
Multiple X sessions tw001_tw Slackware 9 05-31-2004 12:35 PM
Multiple X sessions gluon Linux - General 1 09-29-2001 10:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration