diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-04-26 16:13:58 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-05-01 22:29:46 +0200 |
commit | a35ebce73a621f68b3020dc8747f2bc0007f0766 (patch) | |
tree | 5a3425d1c718b4ab061c00669a6b67f025a07136 | |
parent | 08ce39989f2617f3b97e1c6e9756b44b21b7c320 (diff) |
Add helper to find contacts with imag-contact in mutt
-rw-r--r-- | etc/imag-contact-mutt-query-command-helper.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/etc/imag-contact-mutt-query-command-helper.sh b/etc/imag-contact-mutt-query-command-helper.sh new file mode 100644 index 00000000..aac0b15a --- /dev/null +++ b/etc/imag-contact-mutt-query-command-helper.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# A helper script for the mutt query_command +# +# Use +# +# query_command = "/path/to/this/script %s" +# +# in mutt to search contacts from mutt with imag. +# + +# mutt wants a one-line status message before the list of contacts. +echo "Searching with imag ..." +imag contact find "$1" --json | \ +jq --raw-output ' + map(.fullname[0] as $FN + | .email + | map({email: ., fullname: $FN})) + | flatten + | map([.email.address, .fullname, .email.properties.TYPE]) + | .[] + | @tsv +' |