Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Oct 2005 20:13:23 -0400
From:      Joe Marcus Clarke <marcus@marcuscom.com>
To:        euro@i.com.ua
Cc:        freebsd-gnome@freebsd.org
Subject:   Re: gnome-session and mobile profiles
Message-ID:  <1128989603.54731.9.camel@shumai.marcuscom.com>
In-Reply-To: <1128941315.788.0.camel@localhost>
References:  <1128941315.788.0.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-51Kc2q5CLwYO83qDTOd4
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mon, 2005-10-10 at 12:48 +0200, Eugene Rogoza wrote:
> Hello everybody,
>=20
> 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.
>=20
> 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
>=20
> Exec=3Dgnome-session
>=20
> to
>=20
> Exec=3Dgnome-session --choose-session=3DSessionName
>=20
> 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.
>=20
> 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=3Dgnome-sessio=
n
> --choose-session=3DSessionName"? 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.
>=20
> 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

--=20
PGP Key : http://www.marcuscom.com/pgp.asc

--=-51Kc2q5CLwYO83qDTOd4
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQBDSwOjb2iPiv4Uz4cRAmauAJ9cdGOxyDPDfVfDrmLHy5Iz47sx1gCcDuYp
zPnfShz4sE5pl2NeQvJDFIw=
=xISr
-----END PGP SIGNATURE-----

--=-51Kc2q5CLwYO83qDTOd4--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1128989603.54731.9.camel>