You are not logged in.
Is there a way to change an environment variable so that all the future processes get the new value without restarting the shell?
Here is my use case, I have two sound cards and I can select them via environment variable. Of course I can start a terminal, export the variable, and start a program. But it would be nice to change it with ease with for all the program executed by the menu.
Offline
export VARIABLE=valuehttp://www.cyberciti.biz/faq/set-enviro … ble-linux/
Edit: Sorry.. nevermind.
Last edited by chronozphere (2013-09-18 09:16:30)
Offline
But it would be nice to change it with ease with for all the program executed by the menu.
Then you'd need to change the environment variable in the "menu".
What menu is this? Is it in a WM/DE? Which one?
One approach is to relaunch the menu. You don't need to "relogin", just something like:
killall <menuprogram> && SOUNDVAR=your_value <menuprogram>whenever you want to change the value of SOUNDSVAR. That could be in a script that could read from /proc/.../environ to determin which is the current value and toggle to the other.
But the specifics all depend on what menu/de/wm you are talking about.
Last edited by Trilby (2013-09-18 11:52:25)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I use xfce4, it is pretty much default with only few tweaks there and there. I tried killing the menubar and the panel program (xfce4-panel) restart by itself, but your idea sounds good. I try to work with it.
Offline