• # Script que j'utilise avec Thunderbird et Opera

    Posté par . En réponse au message Firefox && Thunderbird: comment les marier ???. Évalué à 4.

    Opera utilise la ligne de commande suivante :
    thunderbirdmail mailto:[%t]?cc=[%c]&subject=[%s]&body=[%b]

    Et thunderbirdmail correspond au script suivant (trouvé je ne sais plus où) :

    #!/bin/sh
    ## Variables
    THUNDERBIRD="/usr/bin/thunderbird"
    PARAM="";

    # Check if command line arguments have the form "mailto:somebody@somewhere.com?subject=something"
    # if that's true put "somebody@somewhere.com?subject=something" in MAILTO address
    MAILTO=`echo $@ | awk -F\: '1ドル ~ /mailto/ {print 2ドル}'`

    # force %d-%m%-Y dateformat
    export LC_TIME=fr_FR;

    # Check if Thunderbird is running. (Ugly hack, remote options doesn't work)
    TBNUM=`ps -A | grep -c thunderbird-bin`;

    if [ $TBNUM -eq 0 ]; then
    # No running Thunderbird instance: fire up a new copy of the email client.
    if [ -z $MAILTO ]; then
    # No email address, just run Thunderbird
    exec $THUNDERBIRD &
    else
    # Run Thunderbird and open a compose window with the address 1ドル in the To: field
    exec $THUNDERBIRD -mail "mailto:$MAILTO" &
    fi
    else
    if [ -z $MAILTO ]; then
    # No email address: open inbox.
    PARAM="xfeDoCommand(openInbox)";
    else
    # Start new compose window with the address 1ドル in the To: field
    PARAM="mailto($MAILTO)";
    fi

    # Open new compose window, or inbox in an already running Thunderbird instance.
    exec $THUNDERBIRD -remote "$PARAM" &
    fi