Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Changed html file assoc. in KDE, but have issues (Firefox Profiles)
I've changed the html association in KDE, (3.1.4 in SuSE 9), to open Firefox, (firefox is installed in my home directory). If I click on an html file in Konquerer it starts Firefox and displays the html page. However, if Firefox is still open and I click on another html file in Konquerer, Firefox tries to open another instance of itself and it prompts me for a profile to use. If I choose my default profile, it errors, saying it is already in use.
Does anyone know of a way to prevent this from happening? Thanks.
When I click on an html file I can now get Firefox to open a new window or tab, but it does not display the file I've clicked on, it just opens a blank window, (or tab).
So part of the problem is solved. I would appreciate any insight into the remaining problem. Thanks.
Changed html file assoc. in KDE, but have an issue (Firefox profiles)
I found this in a newsgroup. The person who posted it could not site the original post or author. Here it is and it works well.
Quote:
I think your problem is that you're running mozilla-bin twice or more
and you need your apps to send their browser request to mozilla.sh. The
mozilla.sh is a dumb little script that says "open an instance of
mozilla-bin if one is not running, otherwise open a new window (or tab)"
Here's what my script looks like, it's for firefox, but you'll get the
concept:
#!/bin/sh
MOZILLA="/usr/bin/mozilla-firefox"
if $MOZILLA -remote "ping()" 2>/dev/null
then
echo "Mozilla already launch"
location=",new-tab"
exec $MOZILLA -remote "openURL($1$location)"
else
exec $MOZILLA "$@"
fi
exit 1
you could copy this, change the appropriate names and locations, save as
mozilla-remote in the /usr/bin directory (make it executable ). and
then tell KDE or whatever environment you're using to use
"mozilla-remote.sh" as your default browser.
I ran the script that you posted above. And a couple aproblems still there.
1. If I don't have Firefox open and I am in my mail and click a url then FIrefox doesn't open.
2. If Firefox is open and I click a url in my mail then Firefox opens a new tab but not the url.
I assume that you've already changed the html association in KDE or whatever to use this script, correct? And did you change the path locations to match where you have Firefox installed and make it executable? I did not have any issues with the script myself.
Actually, the only way I've tested it is by clicking on a .html file from my local file system, I have not tested the script by clicking on an url from an email - although in theory I think it should work.
Ok now Im getting a little closer. The first scrip would open a new tab but not open fire fox if it was not already open. The second would open firefox if it was not open but wouldn't open a new tab. So I combined them like this:
# find pid of running moz, if any, for current user
PID=`ps -ef | grep $USER | grep firefox-bin |\
grep -v "grep" | awk '{print $2}'`
# if moz is not running, start normally
if [ $PID="" ]; then
/home/steve/.firefox/firefox $1;
fi
if $MOZILLA -remote "ping()" 2>/dev/null
then
echo "Mozilla already launch"
location=",new-tab"
exec $MOZILLA -remote "openURL($1$location)"
else
exec $MOZILLA "$@"
fi
exit 1
---------------------------------------------------------------------------------------
With this script if I click a url in my mail it will open fire fox if not already running and if it is running it opens a new tab. However the url location doesn't open in either instance. If fie fox is not running then I go to my home page and if it is I get a blank tab. I'll keep playing with it but I assume that the line:
exec $MOZILLA -remote "openURL($1$location)"
supposed to do this. But Im not sure as I really have no Idea what Im doing. Just trial and error. I edit the script save and click a url and see what happens. Thanks for any direction.
Um the one I posted should be opening things in a new tab always, you have to select "always show tabs even if only one document is open" in the firefox options.
Originally posted by Kovacs Um the one I posted should be opening things in a new tab always, you have to select "always show tabs even if only one document is open" in the firefox options.
Kovacs' solution worked perfectly for me. Thank you.
This script does work as it is said to work here. ie: if I have a link on my desktop that I double click it opens in firefox as intented, but still doesn't wotk from Thunderbird when I click on a link in my e-mail. I really don't have any links on my desktop so... I don't know what I need to add to the script to get it to, umm? "export" the link that I am clicking on to firefox. Clicking on the link in TB does open a new tab or the browser respectively but firefox seems to have no Idea at that point where I need to go. The odd thing is in my RSS client if I click on a link to a torrent file (I have a helper app setup in FF to open .tor files) a new tab opens in FF and my helper app opens and and starts running witht the .tor file. So I take this to meant that the url is being seen by FF but for some reason it is not opening in the tab. I am so lost. I know where I want to go I can see the destination from where I stand , but I don't seem to be able to drive very well I need some instruction.
Thanks
quest
Sorry for dragging up an old thread. I used the above script to be able to open links in already open browser in Gnome. however, the problem i have encountered, while not serious as this setup is only one of many for me, is that if firefox is open on a different screen than on the one that i click the link on. I assume that it would work if i were using Xinerama, however, xinerama screws with matlab.
if there is a way to get it to work, it would be much appreciated...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.