LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   LD_LIBRARY_PATH added to .bashrc but only works if apps launched from terminal (http://www.linuxquestions.org/questions/linux-desktop-74/ld_library_path-added-to-bashrc-but-only-works-if-apps-launched-from-terminal-906002/)

snowweb 10-01-2011 10:38 PM

LD_LIBRARY_PATH added to .bashrc but only works if apps launched from terminal
 
The Firefox extension for integration with kwallet requires me to add the following to my path variables:

Code:

# Added by Peter on 10/01/11 to make the firefox extension for kde-wallet work.
LD_LIBRARY_PATH=/usr/lib/kde4/libkdeinit:/usr/lib/xulrunner-1.9.2.23
export LD_LIBRARY_PATH

I have therefore added the above code to my .bashrc file, which solves the problem when Firefox is launched from the command line, however, this is not ideal because if I launch a website from a link in an external application, then kwallet won't work with it.

What is the solution please?

Kind regards,

Peter

OS: Ubuntu 10.10
Desktop: KDE 4
Browser: Firefox 7
Kernel: 2.6.35-30-generic
kwallet extension ver: 0.12

j-ray 10-02-2011 03:41 AM

I'm not completely sure but I think you better export the variable in your ~/.profile file. Then it should be read at login time.

snowweb 10-02-2011 11:59 AM

Quote:

Originally Posted by j-ray (Post 4487788)
I'm not completely sure but I think you better export the variable in your ~/.profile file. Then it should be read at login time.

Thanks for that Ray, but unfortunately that doesn't seem to have worked. I logged off and back on and then launched Firefox normally, but it didn't start the kde-wallet extension (I'm sure there's a command I can use to see what my paths are, but I don't know it).

Thanks for taking a stab at this.

Pete

rikxik 10-11-2011 03:57 AM

Disclaimer: this is more of a cludge and not a neat solution.

1. Rename the firefox binary to firefox_original
2. Create a small shell script which sets the variable and then launches firefox_original
3. Save the script as "firefox" in one of the locations in your PATH.

knudfl 10-11-2011 04:26 AM

Another proof way : Add the paths to the firefox start script
( firefox/firefox ) , line 52


export LD_LIBRARY_PATH=/usr/lib/kde4/libkdeinit:/usr/lib/xulrunner-1.9.2.23:/usr/lib:/lib

rikxik 10-12-2011 12:32 AM

Quote:

Originally Posted by knudfl (Post 4495358)
Another proof way : Add the paths to the firefox start script
( firefox/firefox ) , line 52


export LD_LIBRARY_PATH=/usr/lib/kde4/libkdeinit:/usr/lib/xulrunner-1.9.2.23:/usr/lib:/lib

This is definitely better. Just didn't remember that firefox already was being launched via a wrapper script.

jschiwal 10-12-2011 01:16 AM

Check which bash startup scripts you have. There are others such as .bash_login and .bash_profile. The bash info manual indicates which one comes first. ( Actually it is common for distro's to source .bashrc then running .profile )

Also, you need to log out and in again after editing .profile ( or .bash_login or .bash_profile ). It is sourced when you log in. Editing the file, and even sourcing it won't help, because you are in the environment of a subshell of your login shell. If your .profile script sources .bashrc, maybe it would have worked if you logged out.

---

You could also add the assignment to the command.

Look at the properties for the Firefox icon. In the Application entry, add: "LD_LIBRARY_PATH=/usr/lib/kde4/libkdeinit:/usr/lib/xulrunner-1.9.2.23 " before "firefox %u".
You can do the same thing in the menu editor, and entry on the panel.

I'm using KDE, and assume you can do the same in gnome.

snowweb 10-14-2011 11:38 PM

Solved!
 
Quote:

Originally Posted by knudfl (Post 4495358)
Another proof way : Add the paths to the firefox start script
( firefox/firefox ) , line 52


export LD_LIBRARY_PATH=/usr/lib/kde4/libkdeinit:/usr/lib/xulrunner-1.9.2.23:/usr/lib:/lib

Many thanks for your help. This one solved it. :-)


All times are GMT -5. The time now is 05:51 AM.