diff options
| -rw-r--r-- | Makefile | 4 | ||||
| -rwxr-xr-x | bin/m | 4 | ||||
| -rwxr-xr-x | bin/mailcfg | 15 |
3 files changed, 21 insertions, 2 deletions
@@ -23,6 +23,7 @@ derived-assets = \ $(XDG_CONFIG_HOME)/msmtp/config \ $(XDG_CONFIG_HOME)/notmuch/default/config \ $(XDG_CONFIG_HOME)/notmuch/default/hooks/post-new \ + $(XDG_DATA_HOME)/euandreh/mailcfg-accounts.txt \ $(XDG_DATA_HOME)/common-lisp/source \ $(XDG_DATA_HOME)/euandreh/e.list.txt \ $(lisp-images) @@ -56,6 +57,9 @@ $(XDG_CONFIG_HOME)/notmuch/default/hooks/post-new: bin/mailcfg mailcfg notmuchhook > $@ chmod +x $@ +$(XDG_DATA_HOME)/euandreh/mailcfg-accounts.txt: bin/mailcfg + mailcfg list > $@ + $(XDG_CONFIG_HOME)/ssh/id_rsa.pub: gpg --export-ssh-key eu@euandre.org > $@ chmod 600 $@ @@ -59,6 +59,8 @@ done shift $((OPTIND - 1)) +F="${XDG_DATA_HOME:-$HOME/.local/share}"/euandreh/mailcfg-accounts.txt + notmuch new -mbsync -a +xargs -I% -P "$(wc -l < "$F")" mbsync '%' < "$F" notmuch new diff --git a/bin/mailcfg b/bin/mailcfg index e31ab67..f77355e 100755 --- a/bin/mailcfg +++ b/bin/mailcfg @@ -22,6 +22,7 @@ help() { - notmuchcfg - notmuchhook - alot + - list Emit the generated configuration file for the chosen email @@ -57,6 +58,11 @@ help() { Get the alot configuration file: $ mailcfg alot + + + List the existing account labels: + + $ mailcfg list EOF } @@ -271,9 +277,16 @@ alot() { done } +list() { + for env in "$CFGDIR"/*.env; do + . "$env" + printf '%s\n' "$LABEL" + done +} + case "$ACTION" in - mbsync|msmtp|notmuchcfg|notmuchhook|alot) + mbsync|msmtp|notmuchcfg|notmuchhook|alot|list) "$1" ;; *) |
