Skip to content

Instantly share code, notes, and snippets.

Last active March 27, 2021 02:55
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# Important disclaimer: I have no idea what I'm doing
# This script will take the subject line of an email in mutt and add it to your Taskpaper inbox provided that "Inbox:" is the first line of your taskpaper file. The script can be called by a macro in mutt by adding `macro index T "<pipe-entry>~/<enter>"` to your .muttrc file, then T will add the todo item. You may need to make sure that the script is executable. You can adjust the path and name of your taskpaper file below to suit your setup.
TEMPTODO=$(basename "$0")
TMPFILE=$(mktemp /tmp/"${TEMPTODO}".XXXXXX) || exit 1
grep '^Subject:' | awk -F '^Subject:' '{print $2;exit;}' | sed 's/^/ - Email:/' | unexpand -t4 > "$TMPFILE" || exit 1
rm -f "$TMPFILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment