Paul E Condon wrote: > Andrei POPESCU wrote: > > Most display managers don't source ~/.profile (or /etc/profile). I tried > > to discuss this with developers, but there was hardly any interest so I > > settled for sourcing them in ~/.xsessionrc instead (which is sourced by > > the X startup scripts):
It has always annoyed me that logging in with the graphical login managers *by default* do not source the .profile (or .bash_profile) files. And worse when some distros have tried to set this up they have sometimes made a mess of things. (For example SuSE did a hard source of ". ~/.profile >/dev/null 2>&1" with all errors redirected to avoid noise in the case of bash versus not-bash syntax.) Red Hat actually has done the best job of this. I wish Debian would do it similarly. > > ,----[ ~/.xsessionrc ] > > | . /etc/profile > > | . ~/.profile > > `---- My I say that this is elegant in the shear brute force of it? It will work just fine. :-) I prefer: ,----[ ~/.xsession ] | #!/bin/bash --login | exec x-session-manager `---- And VERY IMPORTANT FOR THE ABOVE then be sure to: chmod a+x ~/.xsession The result is the same, that shells source the .profile upon login. It does this by calling the executable script with 'bash --login' so that bash will source the login files of .profile (or .bash_profile). And similarly this works for zsh, ksh, or other users too. > I looked for ~/.xsessionrc and find that I don't have such a file in > my ~/ !!! Why are you surprised? If you didn't create it then why would you have it? Since you didn't know about it then you wouldn't have created it. > But I do have some strange files that I had notice for several months, namely > #.Xresources# #.muttrc# #test# and #x# Lots of files are possible. This is topic drive. > The contents of #.Xresources# and #x# are X resource definitions, but > there are conflicting emacs.geometry values in the two. If it hurts when you do that then don't do that. That file is all of your making. Simply fix it. It really isn't interesting enough to include in this thread. > #.muttrc# is a Mutt rc file with statements in it, which if executed > by Mutt would completely screw up my current setup of Mutt. Again, this is a completely different topic. The .muttrc file is used by mutt and it is your file. You control the contents. The contents are really not interesting when talking about setting PATH at login time. > #test# is empty. Have > you any idea where these came from? It appears to be an attempt at a > new different way of planting configuration data on a per user basis. Please if you want to talk about other topics unrelated to setting PATH at login time it is much better to do so in another thread. > The bottom line is that I don't have an .xsessionrc , and therefore > its not a good place for me to put profile files sourcing. > > Suggestions? If you want it then simply create it. Andrei told you everything you need to know. Specifically that his file had exactly two lines in it and it worked for him to load the two files that he wanted loaded. I as well gave an alternative solution which accomplishes the task in a different way. My preferred method starts up the shell as a login shell and therefore the shell will load up all files that the the shell loads up at login time. The end effect will be very similar. The choice of either of those or yet another method is yours to make. Bob
signature.asc
Description: Digital signature