Linux – How to set environment variables for a graphical login on linux

environment-variableslinuxxorg

I'm looking for a way to set arbitrary environment variables for my graphical login on linux. I am not talking about starting a terminal and exporting environment variables within the terminal, because those variables only exist within that one terminal. I want to know how to set an environment variable that will apply to all programs started in my graphical session.

In other words, what's the Xorg equivalent of ~/.bash_login?

Best Answer

You can always put them in .profile, so they should apply for any login.

Problems occur however, if a .bash_login exists: In that case, bash won't read .profile.

If you want your variables from .profile to apply both in bash and for other logins, don't use .bash_login! Put bash specific variables in .bashrc instead.

Or alternatively, include .profile from .bash_login

Related Question