XFCE/lightdm startup configuration files

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 https://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


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
    PATH="${HOME}/bin:${PATH}"
fi

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.