Home » Questions » Computers [ Ask a new question ]

How do I set an environmental variable for a GNOME session?

How do I set an environmental variable for a GNOME session?

On my system, for apps that use SDL, I need to set an environmental variable:

Asked by: Guest | Views: 238
Total answers/comments: 2
bert [Entry]

"It could be that the SDL_AUDIODRIVER variable is being unset somewhere. One strategy I use for problems with things related to startup scripts is to put in debug echo statements that is simple to enable/disable by creating/deleting a file. You could start by adding

debug_msg() {
test -f $HOME/.debug && echo ""$@"" 1>&2
}

debug_msg ""running ~/.bashrc ($0), SDL_AUDIODRIVER = '$SDL_AUDIODRIVER'""

to .bashrc, .bash_profile, .profile and /etc/profile to see what value it has and if/where it is changing."
bert [Entry]

Create a .gnomerc file in your $HOME which is a shell script (like .bashrc) which sets all the variables you want.