TechSpot

Nautilus : How to add a custom command ?

By Didou
Feb 16, 2004
  1. 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 ).
     
  2. Mictlantecuhtli

    Mictlantecuhtli TS Evangelist Posts: 4,916   +9

    It works in KDE when I use %u instead of %s.

    That www.hoovers.com thing is quite odd, it's like built-in adware, my Firefox went there too when I tried %s.
     
  3. Didou

    Didou Bowtie extraordinair! Topic Starter Posts: 5,899

    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.
     
  4. Didou

    Didou Bowtie extraordinair! Topic Starter Posts: 5,899

    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
     
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.