The Haus

Sunday, July 4, 2004

Calling Firefox from Thunderbird and Vice Versa

One minor annoyance in using Mozilla Firefox and Thunderbird in Linux is getting them to use each other (i.e. Firefox calling Thunderbird for mailto: links and Thunderbird calling Firefox for links in emails). The task is easy in Windows if you set them both as your default apps. It's a bit trickier in Linux. After a bit of Googling, I figured it out. First of all, create two scripts. Call the first firefox.sh

#!/bin/sh

export MOZILLA_FIVE_HOME="/usr/local/firefox"

url="$1"
if [ "x$url" = "x" ]; then
  url="about:blank"
fi

if $MOZILLA_FIVE_HOME/mozilla-xremote-client openURL\("$url"\); then
  exit 0
fi
exec $MOZILLA_FIVE_HOME/firefox "$url"

Call the second one thunderbird.sh

#!/bin/sh

url="$1"

export MOZILLA_FIVE_HOME=/usr/local/thunderbird

if [ $(/sbin/pidof thunderbird-bin | wc -w) -gt 0 ]; then
# thunderbird is running
url=`echo "$url" | sed -e's/^mailto://'`
$MOZILLA_FIVE_HOME/thunderbird -remote "mailto($url)"
else
# thunderbird is not running
$MOZILLA_FIVE_HOME/thunderbird -P default -compose $url
fi

I stashed them both in /usr/bin. Remember to make them both executable. Open up the Gnome Control Center (these programs seem to follow the Gnome settings even though I'm using KDE). Go to Advanced->Preferred Applications. Click on the "Web Browser" tab and type "/usr/bin/firefox.sh %s" (without the quotes) in the "Custom Web Browser" field. Click on the "Mail Reader" tab and type "/usr/bin/thunderbird.sh %s" (without the quotes) in the "Custom Mail Reader" field. After that, everything should work fine. Note: none of this is my original work. I just put it all here for safe-keeping.

This is all a bit annoying. I've heard that the two teams are working on better interoperability. I may have to peruse their Bugzilla just to make sure.

Saturday, July 3, 2004

Test Driving Firefox/Thunderbird

I decided to download and test drive both Mozilla Firefox and Thunderbird since that's where the main development seems to be going on in the Mozilla world. The big feature I'm looking forward to is Thunderbird's multiple identity support. It supposedly works in Mozilla 1.7 too, but there's no GUI for it. It never worked quite right. I'm a little jumpier about trying Thunderbird, simply because I don't want mail spread out through multiple apps. We'll see.

And, yes, I made this post in Firefox.

Update! Thankfully, importing my mail from Mozilla was no more difficult than copying my Mail directory from my Mozilla profile. I had already setup an account in Thunderbird and used the same account name as in Mozilla. So far, I seem to like Thunderbird more, although I can't really put my finger on why.

Past Two Days' News

Recent Headlines

January 5, 2015: It Returns!
August 10, 2007: SCO SUCKS IT DOWN!
July 5, 2007: Slackware 12.0 Released
May 20, 2007: PhpBB 3.0 RC 1 Released
February 2, 2007: DOOM3 1.31 Patch

January 27, 2007: Join the World Community Grid
January 17, 2007: Flash Player 9 for Linux
December 30, 2006: Darkness over Daggerford 1.2
December 19, 2006: Pocket Tunes 4.0 Released
December 9, 2006: WRT54G 1.01.1 Firmware OK with Linux/Mac

All original information on this website is copyright © TheHaus.Net, 1999-2005. The use of original images, text, and/or code from this website without expressed written consent is prohibited. The authors of this site cannot be held responsible for any damage, real or imagined, which comes from the use of information presented on this site. All trademarks used are the properties of their respective owners. This site is not to be used as a floatation device (but if you try, I want a video tape of it).