.bash_profile
is the startup configuration script of bash. There exists no standard mandating X to source .bash_profile
.
What you are thinking of is rather .profile
. Originally it was the startup configuration file of shthe bourne shell (sh). Today many distributions have their desktop environment set up to source .profile
. Note that this is also not a standard, but it seems to be a convention.
Debian used to source .profile
at graphical login (linkwiki page as of 2013 to wiki page as of 2013) now it doesn't (linkwiki page as of 2016 to wiki page as of 2016).
Arch sources .xprofile
at graphical login (linkwiki page as of 2013).
Ubuntu used to discourage using .profile
(linkwiki page as of 2013 to old version in the wiki) now it doesn't discourage anymore (wiki page as of 2016).
Regarding your other question: Why doesn't my ~/.bash_profile work? That is the expected behaviour.
The behaviour, in short, is as follows:
- bash started as an interactive login shell: reads
~/.profile
- bash started as an interactive non-login shell: reads
~/.bashrc
For more details see my answer to a similar question in askubuntu: https://askubuntu.com/questions/132276/configure-gnome-terminal-to-start-bash-as-a-login-shell-doesnt-read-bashrc/132319#132319