Nautilus : How to add a custom command ?

Status
Not open for further replies.

Didou

Posts: 4,190   +11
Here's what I want to do. I would like Nautilus to associate HTML files with Firefox.

So I go to "Hat Menu" -> Preferences -> File types and programs -> Documents -> World Wide Web -> HTML page

I then click on Custom & add the following line :

~/programfiles/firefox/firefox -remote 'openURL (%s, new-window)'

I would like %s to be replaced by the path & filename of the file that I've double-clicked on. If I leave it as is for the moment, Firefox opens up but loads www.hoovers.com instead.

PS. I use the remote parameter, because if I happen to have an instance of Firefox allready running, when I double click on an HTML file, I get a Profile Dialog box because Firefox cannot have two instances using the same profile ( unless someone can show me how ).
 
Issue resolved

It took a lot of fiddling but now I'm done.

create a file & add the following lines in it :

#!/bin/sh

# Modify the FIREFOX_HOME path
# to where your mozilla based
# browser is located
export FIREFOX_HOME=/opt/firebird-builds/current
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FIREFOX_HOME

# get URL to load
url=$1; [ -z $url ] && url=about:blank

# try xremote first
$FIREFOX_HOME/mozilla-xremote-client openURL\($url\) && exit 0

# if xremote failed, then launch the browser
exec $FIREFOX_HOME/MozillaFirebird $url


& then go to "Hat Menu" -> Preferences -> File types and programs -> Documents -> World Wide Web -> HTML page

Click on Custom & direct it to the script you've just created ( do a chmod 777 on that file just in case ). Do not, I reapet do not add %s.

Next up is getting thunderbird to work with that script.
 
I'm really keeping an eye on Fedora & it seems one of the problems I had with RHL 9 has been taken care of in FC2.

Taken from -> Firefox and Thunderbird for FC2
Fedora Extras has published today firefox and thunderbird packages for FC1 and FC2. These packages have been heavily patched and polished to integrate nicely into the Preferred Applications framework of FC2. This means that you can go into the Preferences -> Preferred Applications chooser, select Firefox & Thunderbird, and the GNOME desktop should fully honor your choice of browser and mail client when clicking hyperlinks in various programs of FC2.

http://www.fedora.us/wiki/FedoraHOWTO
Please follow the directions on this page if you do not already use Fedora Extras. Report problems of firefox & thunderbird to bugzilla.fedora.us.

http://togami.com/~warren/archive/2004/foxbird.sh
FC1 users can also use firefox & thunderbird from the Fedora Extras stable repository, but unfortunately the Preferred Applications framework in FC1 is a bit broken. As a workaround you can run this script as your non-root user to set your profile to use these two applications.

Warren Togami
wtogami redhat com
 
Status
Not open for further replies.
Back