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.

It is most weird. I have set the environment variable TEST in .bashrc, .bash_profile, .profile, /etc/profile and /etc/profile.d/ - everywhere a sane computer might look for it:

TEST=successfull
export TEST

And when I open a terminal window, typing "echo $TEST" or "env" gives me the value of this variable nicely.

However, when I doubleclick an .desktop-file, the environment variable does not exist. And, strangely, when I fire up geany with a simple file containing

#!/bin/bash  
env
echo $TEST

, and execute it by pressing F5, it opens up a terminal window - and it won't show the value of TEST. If I start this same file from any terminal window - the environment variable is there as expected!!

This bothers me since its illogical and it blocks steam from running - steam requires the variable LD_LIBRARY_PATH. I put in "steam" in terminal - all loads fine. But if I doubleclick any steam icon - which does nothing more than execute "steam" with some parameters - nothing happens - because it cannot find its LD_LIBRARY_PATH.

I run Linux Mint LMDE with all updates installed. The same problem occurs wheter "gnome-terminal" or "mate-terminal" acts as gui frontend.

Can you reproduce? If yes, where is the bug?

share|improve this question

migrated from serverfault.com Jul 28 '13 at 1:32

This question came from our site for professional system and network administrators.

2 Answers 2

You have to put the variable in /etc/environment.

share|improve this answer

It seems your desktop application does not inherit the variables you have set. Try to put: export TEST=successfull into your ${HOME}/.xinitrc, then restart X and see if it works.

share|improve this answer

Your Answer

 
discard

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