Environment variables


Forum: HD Install
Topic: Environment variables
started by: gunter

Posted by gunter on June 01 2007,14:20
Hello,

Im trying to initialize an application after X starts. To do this, I have to set LD_LIBRARY_PATH. Now I have two questions:

Where can i set the variable so that it is available whenever  i reboot?

And the app? I tryed the .xinitrc but dont work!

Thanks!

Posted by mikshaw on June 01 2007,16:29
The LD_LIBRARY_PATH variable can be set at any time between your login and the time the application that requires it is run. It would probably be most convenient to set it just before running the application that needs it, just for the sake of being organized.

There is a particular way to start applications from .xinitrc, particularly in DSL due to its use of multiple window managers. There is a "case" block in .xinitrc that controls which window manager is started. If you want an application to load in X, it must start before that part of .xinitrc runs. The command to start your application should also be followed by "&" to allow .xinitrc to continue and complete the X startup.

Here's an example:
Code Sample
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/something/lib"
my_application &
case "$DESKTOP" in .....


another example:
Code Sample
LD_LIBRARY_PATH=/opt/something/lib my_application &
case "$DESKTOP" in .....


The first example exports LD_LIBRARY_PATH, including any paths that may already exist in the variable, so it is available to all applications run from X, unless the variable is again changed for use in a child shell.

The second example sets LD_LIBRARY_PATH only for my_application

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.