diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2022-11-10 00:41:13 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2022-11-13 12:57:41 +1300 |
commit | ede095ce97e7f7ba532edb5359b9d13a21e2bcc4 (patch) | |
tree | daae6607ea996392ecd6fc5444741beb7862d50d /mutt/muttrc.d/src.sh | |
parent | Remove executable bit from some shell scripts (diff) | |
download | dotfiles-ede095ce97e7f7ba532edb5359b9d13a21e2bcc4.tar.gz dotfiles-ede095ce97e7f7ba532edb5359b9d13a21e2bcc4.zip |
Set shebang for muttrc.d/src at build time
Diffstat (limited to 'mutt/muttrc.d/src.sh')
-rw-r--r-- | mutt/muttrc.d/src.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mutt/muttrc.d/src.sh b/mutt/muttrc.d/src.sh new file mode 100644 index 00000000..60e0c566 --- /dev/null +++ b/mutt/muttrc.d/src.sh @@ -0,0 +1,24 @@ +# Build groups from address lists +for rc in "$HOME"/.config/mutt/muttrc.d/groups/*.list ; do + [ -e "$rc" ] || continue + group=$rc + group=${group##*/} + group=${group%.list} + while read -r member ; do + printf 'group -group %s -addr %s\n' \ + "$group" "$member" + done < "$rc" +done + +# Emit the source all muttrc subfiles, in LC_COLLATE order +for rc in "$HOME"/.config/mutt/muttrc.d/*.rc ; do + [ -e "$rc" ] || continue + cat -- "$rc" +done + +# Special case: if using GNU Emacs, emit a line to disable edit_headers, just +# because at the moment I haven't worked out how to make this work sanely with +# messages-are-flowing in message-mode. +case $VISUAL in + emacs|emacsclient) printf 'unset edit_headers\n' ;; +esac |