For gdm the shell environment variables is sourced in /etc/X11/gdm/Xsession. From this script .profile is sourced in Ubuntu. Other distros often sources other shell spesific profile files like .bash_profile. I proposed a solution to this in bug #69700.
-- .bash_profile is not sources when X session starts https://launchpad.net/bugs/66004 -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs