diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-06 18:14:11 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-06 18:14:11 +0100 |
commit | 4cd8f7ccee3f5dc85473c1d797f9d9ebf6b2872e (patch) | |
tree | 93ac336319cb1e5ee9b9d1bddfff643d2dcbb254 | |
parent | cd6956cbafdaee3d1e8a5d8fc92608983295293e (diff) |
aqry: Add script to query addresses for aerc
-rw-r--r-- | .config/aerc/.gitignore | 1 | ||||
-rw-r--r-- | .config/aerc/aerc.conf | 1 | ||||
-rwxr-xr-x | .local/bin/aqry | 15 |
3 files changed, 17 insertions, 0 deletions
diff --git a/.config/aerc/.gitignore b/.config/aerc/.gitignore new file mode 100644 index 0000000..d96f8fb --- /dev/null +++ b/.config/aerc/.gitignore @@ -0,0 +1 @@ +addresses diff --git a/.config/aerc/aerc.conf b/.config/aerc/aerc.conf index 4638673..4a89985 100644 --- a/.config/aerc/aerc.conf +++ b/.config/aerc/aerc.conf @@ -22,6 +22,7 @@ alternatives=text/plain [compose] header-layout=To|From,Cc|Bcc,Subject file-picker-cmd=fzf +address-book-cmd=aqry '%s' [filters] text/plain=colorize diff --git a/.local/bin/aqry b/.local/bin/aqry new file mode 100755 index 0000000..6daef5d --- /dev/null +++ b/.local/bin/aqry @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +readonly ADDR_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/aerc/addresses" + +awk -v qry="$1" ' +BEGIN { + FS = "\t" +} + +$1 ~ qry { + printf "%s\t%s\n", $2, $1 +} +' "$ADDR_FILE" |