[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash profile not sourced under X



"Todd A. Jacobs" <nospam@codegnome.org> writes:

> I'm running Debian Sarge, with GDM launching X. I've noticed that
> changes to PATH and TZ as set in ~/.bash_profile aren't taking effect
> under X. They work fine in a normal login on a VT, but not under GDM.
>
> Is there something that needs to be changed to have GDM execute the
> profile at login? I'm thinking that, for whatever reason, bash is never
> treated as a login shell under GDM the way it is on my Red Hat boxes.

Annoyingly (and very stupoidly IMHO) the X environment doesn't run the
profile scripts.

Instead they are designed to run their own script called:

   $HOME/.xsession

You could define your own xsession file but that stops gnome and your
window manager running.

You can get round that by running them explicitly in your .xsession
file.

I think that GNOME *should* provide a startup script of it's own from
which you could ensure that your profile was executed.



Here's my .xsession file:


  #!/bin/sh

  if [ -f ~/.bashrc ] ;
  then
     . ~/.bashrc
  fi

  swisswatch -geometry -50-50 &

  emacs &

  /usr/bin/x-window-manager


Note that everything is started in the background because commands not
run in the background never return. The very last command is the call
to the window manager.

You might make the last call do this:

  /usr/bin/x-session-manager

which shoiuld load GNOME, you'll have to experiment a little bit.


Note that it's sensible to use .bashrc as the source for all common
config and not .bash_profile. The profile is for a login shell, which
is not what an X session really is.


Nic Ferrier
http://www.tapsellferrier.co.uk




Reply to: