However I ran into a problem using it. Thunderbird was not running, though I did have a process running which had the string "thunderbird" as part of an argument. (nano -w /usr/local/bin/thunderbird-mailto.sh) I then clicked on a mailto: link, and it did not run Thunderbird. I eventually traced it back to it falsely detecting an already running instance of Thunderbird.
I modified the script to use a more robust way of detecting if the process is already running. I also quoted what is after the -compose argument.
Code: Select all
export MOZILLA_FIVE_HOME="/usr/lib/MozillaThunderbird"
THUNDERBIRD_PATH="/usr/lib/MozillaThunderbird"
if [ -z "`/bin/ps x | /bin/grep \"[0-9] ${THUNDERBIRD_PATH}/thunderbird-bin\"`" ]; then
# No MozillaThunderbird running
${THUNDERBIRD_PATH}/thunderbird -P default -compose "mailto:$1?subject=$2"
else
# MozillaThunderbird running
${THUNDERBIRD_PATH}/thunderbird -remote "mailto($1?subject=$2)"
fi