PATH ~/bin under gnome

Peter Garrett peter.garrett at optusnet.com.au
Thu Nov 23 12:12:40 UTC 2006


On Thu, 23 Nov 2006 11:12:25 +0000
Adam Funk <a24061 at yahoo.com> wrote:

> > There's a nearly universal solution: use ~/.xsession, place your environment
> > variable modification at the top and exec the appropriate session script
> > at the end (e.g. exec /usr/bin/gnome-session).  Then choose "custom" in
> > your login manager.
> ...
> > The downside to this approach is that you cannot choose different
> > sessions in your display manager's menu and expect your environment
> > variable settings to appear in each of them.
> 
> Hmm.  I like having the flexibility of being able to use a different
> DM occasionally.  I recently saw a cryptic reference to ~/.xprofile
> somewhere --- is that relevant?

One work-around is to edit the *.desktop files in /usr/share/xsessions to
point at a number of ~/.xsession files with different names - for example
~/.xsession.enlightenment , ~/.xsession.fluxbox , and so on , and add your
modifications there. (Of course you can call those files whatever you like
and put them elsewhere if you wish, as long as the "Exec= " line points at
them and they are executable. ) This way you get entries for each DE/ wm in
your gdm login screen .

This tends to be easiest with simple window managers like fluxbox, or
enlightenment etc - you have a chicken-and-egg problem if you put
modifications to gnome-session in such a file for example, since 
you would normally have to call gnome-session from the script as its last
line, and that would reverse your intentions unless you did some tricky
legwork. Of course, using ~/.gnomerc gets rid of that issue as discussed
earlier in the thread.

One hack is to start your ~/.xsession.foo (or whatever) pointed to
from /usr/share/xsessions/foo.desktop  with something like

#!/bin/bash

# window manager or DE session here

/usr/bin/foo & wmpid=$!

#Insert your bits and pieces here with ampersands to background as requir
blah blah &
more stuff &
something that exits anyway  #no ampersand required

# Hang point

wait $wmpid

I do this with fluxbox - this way fluxbox starts up first rather than
last, but the script only exits when fluxbox exits, which is the same
behaviour as if you put the "fluxbox" command last.

Hope that makes sense...

Peter





More information about the ubuntu-users mailing list