#! /bin/bash # mailto_handler (Bourne shell script) -- invokes an e-mail composer window # # Keywords: arrays KDE # split the parameter up into components url_contents=${1#mailto:} addr=${url_contents%%\?*} if [[ $1 = *\?subject=* ]] ; then subject=${1#*\?subject=} # FIXME: dequote it fi if false ; then echo contents: "$url_contents" echo addr: "$addr" echo subject: "$subject" fi # create argument array declare -a args if [[ -n "$subject" ]] ; then args[${#args[@]}]=--subject="$subject" fi args[${#args[@]}]=--header="To: $addr" # use QDBus to invoke MailerService ksendemail "${args[@]}"