gnome-session and mobile profiles
Joe Marcus Clarke
marcus at marcuscom.com
Mon Oct 10 17:13:26 PDT 2005
On Mon, 2005-10-10 at 12:48 +0200, Eugene Rogoza wrote:
> Hello everybody,
>
> I'd like to share several thoughts regarding the usage of gnome-session.
> Perhaps I'm inventing the wheel, but I haven't found any other way to
> accomplish my task.
>
> I have a laptop which physically travels from one building to another
> and is thus a mobile client. Each time it has to connect to a new
> network. What I'm trying to do is to tell FreeBSD my current location
> via GDM login (session selection), so that the proper (self-made)
> network initialization script would be run. In other words, for the same
> user I want to be able to choose among "network profiles".
> The first thing I noticed is that "GNOME sessions" and "GDM sessions"
> are not the same, although, as stated in (GNOME) documentation, "...When
> you log in on GDM, you choose a session. When you choose a session, you
> can select which of the multiple sessions to use". Gnome sessions use a
> file '~/.gnome2/session' whereas GDM sessions are usual '.desktop' files
> residing in '/usr/X11R6/share/gnome/xsessions' (or alternatively in the
> directories described in GDM help page). So, to be able to add a
> GDM-session (exactly what I need) one has to copy and customize
> some .desktop-file. After that one has to change one line
> in .desktop-file, which is
>
> Exec=gnome-session
>
> to
>
> Exec=gnome-session --choose-session=SessionName
>
> which reads the contents of '~/.gnome2/session' as well as
> '~/.gnome2/session-manual'. The latter one contains the list of
> "additional" programs that are to be started automatically (as defined
> via "Sessions" -> "Startup programs" dialog box). This is exactly the
> facility which allows me to run my network init scripts.
>
> The question is: could I have done all of that using only
> "Buttons-and-dialog-boxes-mode" without having to explore and manually
> edit various configuration files and manually adding "Exec=gnome-session
> --choose-session=SessionName"? I believe that GNOME GUI (and
> 'gnome-session' in particular) has been designed exactly for that.
> Otherwise I see no point in "Sessions" dialog box. To be precise, I see
> no point in that part of it which allows me to add a new session, edit
> the existing one or delete it. The entries to '~/.gnome2/session' are
> being made, but they are not being used anyhow afterwards.
>
> Am I expecting too much from gnome-session? Or am I using it
> incorrectly?
Seems to me like a shortcoming in gnome-session. Or maybe, it's a
limitation in the integration between GDM and gnome-session. It sounds
like you're doing it more or less correctly. You configure the GNOME
sessions you want, then create a GDM session for each GNOME session.
One thought on making this more scalable is to write a script that reads
the ~/.gnome/session file, and uses zenity to present the user with a
list of valid GNOME sessions (using zenity --list --radiolist). The
user could pick the session they want, then the script would spawn
gnome-session with the correct session argument. Check the zenity man
page for some examples.
You could then create one GDM session that spawns this script.
Joe
--
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-gnome/attachments/20051010/39e6418b/attachment.bin
More information about the freebsd-gnome
mailing list