Firebird, Thunderbird and Desktop integration fixes

Warren Togami warren at togami.com
Wed Dec 17 09:00:36 UTC 2003


Jaap A. Haitsma wrote:
> 
> ------------------------------------------------------------------------
> 
> #!/bin/sh
> #set -x # Uncomment "set -x" for debugging
> 
> export MOZILLA_FIVE_HOME="/usr/lib/MozillaFirebird"
> FIREBIRD_PATH="/usr/lib/MozillaFirebird"
> 
> if [ -z "`ps x | grep \"[0-9] ${FIREBIRD_PATH}/MozillaFirebird-bin\"`" ]; then
>     # No MozillaFirebird running
>     ${FIREBIRD_PATH}/MozillaFirebird $@
> else
>     # MozillaFirebird running - open a new window
>     ${FIREBIRD_PATH}/MozillaFirebird -remote "openURL($@ ,new-window)"
> fi 
> 
> 
> ------------------------------------------------------------------------
> 
> #!/bin/bash
> #set -x # Uncomment "set -x" for debugging
> 
> export MOZILLA_FIVE_HOME="/usr/lib/thunderbird"
> 
> #check if command line arguments have the form "mailto:somebody at somewhere.com?subject=something"
> #if that's true put "somebody at somewhere.com?subject=something" in MAILTO address
> MAILTO=`echo $@ | awk 'BEGIN{FS=":"} $1 ~ /mailto/ {print $2}'`
> 
> THUNDERBIRD_PATH="/usr/lib/thunderbird"
> 
> if [ -z "`ps x | grep \"[0-9] ${THUNDERBIRD_PATH}/thunderbird-bin\"`" ]; then
>     # No thunderbird running
>     ${THUNDERBIRD_PATH}/thunderbird $@
> else
>     # thunderbird running - raise window
>      ${THUNDERBIRD_PATH}/thunderbird -remote "xfeDoCommand(openInbox)"
> fi 
> 
> if [ -n "$MAILTO" ]; then
>     ${THUNDERBIRD_PATH}/thunderbird -remote "mailto($MAILTO)"
> fi

I could be wrong about this, but I believe using "ps x" must be avoided 
because this totally fails in cases like remote X.  xremote is the 
proper way to use an existing mozilla-compatible application. 
Unfortunately this is greatly complicated by thunderbird's behavior.

Your mailto detection is a good idea though.

Warren





More information about the fedora-devel-list mailing list