sending images from picasa with thunderbird
May 8th, 2008
Tags: debian, picasa
Using thunderbird to sending images from picasa does not work per default. A little script is needed.
1. Create this file
- /opt/picasa/bin/picasa-hook-email.sh
2. paste this code into the file and store it
- #!/bin/bash
- # Thunderbird may fail on some systems because of Picasa's
- $LD_LIBRARY_PATH
- unset LD_LIBRARY_PATH
- # Find the Thunderbird executable
- THUNDERBIRD=$(which icedove 2> /dev/null)
- if [ -z "$THUNDERBIRD" ] ; then
- THUNDERBIRD=$(which thunderbird 2> /dev/null)
- fi
- if [ -z "$THUNDERBIRD" ] ; then
- exit 1
- fi
- ARG=$(echo "$1" | sed 's/^mailto:?//' | sed 's/%/%25/g' | sed 's/,/%2C/g')
- CONTENT=$(echo "$ARG" | sed 's/\&attach=.*//' | sed 's/\&/,/g')
- ATTACH=$(echo "$1" | sed 's/\&attach=/\n\nfile:\/\//g' |awk '/^file:/ { printf "%s,",$0 }')
- NEWARG="${CONTENT},attachment='${ATTACH}'"
- echo "$ARG" > /tmp/xpicasa.tmp
- "$THUNDERBIRD" -compose "$NEWARG"
3. give this script execution permission
- chmod 755 /opt/picasa/bin/picasa-hook-email.sh
4. and restart firefox