Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Have recently installing Debian Wheezy and using XFCE with lighdm.

After logging in with lightdm, my ~/.bash_profile or ~/.profile are no longer sourced. I have previously used these startup files to start ssh-agent, dropboxd and set my PATH variable.

If I understand this link (http://wiki.debian.org/DotFiles) correctly, when a display manager is in use (lightdm in this case). Then it is correct that these files do not get sourced.

So my questions are:
1) how can I make XFCE/lightdm source ~/.bash_profile or ~/.profile
2) what are the equivalent startup configuration files of XFCE/lightdm to start ssh-agent, dropboxd and set my PATH variable.

share|improve this question

2 Answers 2

I've also struggled a lot with this environment variable thing. I'm using Debian Jessie + xfce4

The options that worked for me are(for the environment variables to be caught by the desktop manager):

  • With xdm or lightdm: use ~/.xsessionrc
  • With others, I haven't tested

In the ~/.xsessionrc you may chose to :

  • put directly the variables, like PATH="$PATH:userpath"
  • or source the ~/.profile file: . $HOME/.profile, where the ~/.profile file contains the environment variables definitions

Note the dot in the second option which means source, but I think source is bash specific. The second method is probably recommended (as argued in http://unix.stackexchange.com/questions/4621/correctly-setting-environment) and avoid having the environment variables defined in several files. Also, it's user-specific and not system-wide like (/etc/environment, which actually didn't work so well for me)

For terminal session, since I use bash, I set-up the environment variables in the .bash_profile or I just source the ~/.profile

share|improve this answer
Thanks alot ! Finally! I had to search alot to find this easy solution. One thing to mention: If the file ~/.xsessionrc does not exist, just create it ! –  Alex Aug 22 '14 at 15:09
up vote 1 down vote accepted

OK eventually found a workable solution and went with 2)

To set my PATH variable.
$ cp /etc/xdg/xfce4/xinitrc ~/.config/xfce4
Then edited ~/.config/xfce4/xinitrc to include the following near the top of the file

if [ -d "${HOME}/bin" ] ; then

To start Dropbox when XFCE4 starts
$ xfce4-settings-manager
-> Session and Startup -> "Application Autostart" tab -> Add ->
Name: Dropbox
Command: /home/james/.dropbox-dist/dropboxd
-> OK

As for ssh-agent this gets started in the default xinitrc. (Can anyone recommend a GUI program to supply the passphrase)

Hope this is of assistance.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.