Categories

Configuring Thunderbird As KNotes Mail Action

The steps are really simple.

  1. Save the below script to /usr/local/bin/knotes-mail-wrapper.sh

    #!/bin/bash
    
    set -eu
    
    # See /usr/share/doc/util-linux/examples/getopt-parse.bash for getopt example
    TEMP=$(getopt --name "$0" --options s:,b: --longoptions "subject:,body:" -- "$@")
    
    # Bad arguments, something has gone wrong with the getopt command.
    if [ $? -ne 0 ]; then
      echo "Termintaing ..." >&2
      exit 1
    fi
    
    # Note the quotes around `$TEMP': they are essential!
    eval set -- "$TEMP"
    
    # Now go through all the options
    while true; do
      case "$1" in
        --subject)
          subject=$2
          shift 2;;
    
        --body)
          body=$2
          shift 2;;
    
        --)
          shift
          break;;
    
        *)
          echo "Error parsing arguments" >&2
          exit 1;;
      esac
    done
    
    thunderbird_command=$(command -v icedove >/dev/null 2>&1 && echo icedove || echo thunderbird)
    $thunderbird_command -compose "subject='$subject',body='$body'"
  2. Make the script executable.
    $ chmod +x /usr/local/bin/knotes-mail-wrapper.sh
    
  3. Go to Configure Knotes… -> Actions and in mail action set it to “/usr/local/bin/knotes-mail-wrapper.sh –subject %t –body %f”.

Now whenever you right click on a note toolbar and click on Mail…, thunderbird compose window should pop-up with the subject as the note title and body as the content of the note.

Comments

One response to “Configuring Thunderbird As KNotes Mail Action”

  1. guerini avatar
    guerini

    Simpler here : http://www.das
    Simpler here : http://www.das-werkstatt.com/forum/werkstatt/viewtopic.php?f=7&t=492

    1) Open KNotes.
    2) Right-click on the knotes icon in KDE’s “system tray” – Choose “KNotes einrichten” (Knotes settings?)
    3) On the left, choose “Actions” (Blue KDE wheel)
    4) Replace the “KMail” calling string with

    mozilla-thunderbird -compose subject= %t ,body= %f

    Note:The spaces before and after %t and %f are important, because otherwise, KNotes’ parser won’t see them.

Leave a Reply to guerini Cancel reply

Your email address will not be published. Required fields are marked *