Ok, I think I've got this figured out. I was wrong about the $HOME/.bashrc; it does not get invoked by the shell that starts gnome-session. However, $HOME/.profile does (not sure why it doesn't call $HOME/.bashrc though), so environment variables placed in $HOME/.profile will be inherited by gnome-session. Another way is to add a script to /etc/profile.d/ - environment variables exported by scripts in that directory will be inherited by gnome-session as well.
So go ahead and add your special environment variables to $HOME/.profile (or /etc/profile.d/ if you want to set it for all users.)
For future reference, the environment of any process can be inspected from a special file in the /proc file system: /proc/_processid_/environ. The strings in that "file" are null terminated so to view it use tr to translate. For instance, for the gnome-session process, use ps to find the process id:
Code:
$ ps -efw | grep gnome-session
gmargo 1617 1572 0 12:35 ? 00:00:00 gnome-session
[other stuff snipped]
tr '\0' '\n' < /proc/1617/environ | sort > /tmp/env.gnome-session.txt
Bookmarks