diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 38 | ||||
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | finger/pgpkey | 3 | ||||
-rw-r--r-- | gnupg/gpg.conf | 14 | ||||
-rw-r--r-- | mutt/filters/markdown-to-html.sh | 7 | ||||
-rw-r--r-- | mutt/muttrc | 116 |
7 files changed, 101 insertions, 82 deletions
@@ -185,4 +185,5 @@ /gnupg/profile.d/gnupg.sh.m4 /include/mktd.m4 /less/less +/mutt/filters/markdown-to-html /urxvt/ext/select @@ -279,8 +279,8 @@ GAMES = games/aaf \ games/zs GIT_TEMPLATE_HOOKS = git/template/hooks/post-update \ - git/template/hooks/pre-commit \ - git/template/hooks/prepare-commit-msg + git/template/hooks/pre-commit \ + git/template/hooks/prepare-commit-msg all: $(BINS) \ $(GIT_TEMPLATE_HOOKS) \ @@ -302,6 +302,7 @@ clean distclean: gnupg/profile.d/gnupg.sh \ include/mktd.m4 \ less/less \ + mutt/filters/markdown-to-html \ urxvt/ext/select \ vim/dist/* @@ -455,8 +456,6 @@ install-git: git/config $(GIT_TEMPLATE_HOOKS) install-gnupg: gnupg/profile.d/gnupg.sh install-sh cp -p -- gnupg/profile.d/* $(HOME)/.profile.d - mkdir -m 0700 -p -- $(HOME)/.gnupg - cp -p -- gnupg/*.conf $(HOME)/.gnupg install-gtk: mkdir -p -- $(XDG_CONFIG_HOME)/gtk-3.0 @@ -493,12 +492,19 @@ install-mpv: mkdir -p -- $(XDG_CONFIG_HOME)/mpv cp -p -- mpv/* $(XDG_CONFIG_HOME)/mpv -install-mutt: install-mail - mkdir -p -- $(XDG_CONFIG_HOME)/mutt \ +install-mutt: install-gnupg install-mail mutt/filters/markdown-to-html + mkdir -p -- \ + $(XDG_CONFIG_HOME)/mutt \ $(XDG_CONFIG_HOME)/mutt/muttrc.d \ - $(XDG_CACHE_HOME)/mutt - cp -p -- mutt/muttrc $(XDG_CONFIG_HOME)/mutt - cp -p -- mutt/muttrc.d/src $(XDG_CONFIG_HOME)/mutt/muttrc.d + $(XDG_CACHE_HOME)/mutt \ + $(XDG_DATA_HOME)/mutt/autocrypt \ + $(HOME)/.local/share/mutt/libexec/filters + cp -p -- mutt/muttrc \ + $(XDG_CONFIG_HOME)/mutt + cp -p -- mutt/muttrc.d/src \ + $(XDG_CONFIG_HOME)/mutt/muttrc.d + cp -p -- mutt/filters/markdown-to-html \ + $(HOME)/.local/share/mutt/libexec/filters install-ncmcpp: install-mpd mkdir -p -- $(HOME)/.ncmpcpp @@ -508,7 +514,7 @@ install-newsboat: install-systemd mkdir -p -- $(XDG_CONFIG_HOME)/newsboat $(XDG_DATA_HOME)/newsboat cp -p -- newsboat/config $(XDG_CONFIG_HOME)/newsboat -command -v systemctl >/dev/null 2>&1 \ - && mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \ + && mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \ && cp -p -- newsboat/systemd/user/* $(XDG_CONFIG_HOME)/systemd/user \ && systemctl --user daemon-reload \ && systemctl --user start reload-newsboat.timer \ @@ -564,7 +570,7 @@ install-subversion: install-systemd: -command -v systemctl >/dev/null 2>&1 \ - && mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \ + && mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \ && cp -p -- systemd/user/* $(XDG_CONFIG_HOME)/systemd/user \ && systemctl --user daemon-reload \ @@ -624,11 +630,11 @@ install-vim-after-syntax: install-vim-autoload: mkdir -p -- $(VIMDIR)/autoload cd vim && find autoload \ - -type d -exec sh -c \ - 'mkdir -p -- $(VIMDIR)/"$$1"' _ {} \; \ - -o \ - -type f -exec sh -c \ - 'cp -p -- "$$1" $(VIMDIR)/"$$1"' _ {} \; + -type d -exec sh -c \ + 'mkdir -p -- $(VIMDIR)/"$$1"' _ {} \; \ + -o \ + -type f -exec sh -c \ + 'cp -p -- "$$1" $(VIMDIR)/"$$1"' _ {} \; install-vim-bundle: install-vim-config cd vim/bundle && find */* \ @@ -1,2 +1,2 @@ -tejr dotfiles v9.4.0 -Tue, 19 May 2020 10:15:37 +0000 +tejr dotfiles v9.5.0 +Tue, 19 May 2020 22:57:44 +0000 diff --git a/finger/pgpkey b/finger/pgpkey index 24a1bc66..613c2623 100644 --- a/finger/pgpkey +++ b/finger/pgpkey @@ -7,8 +7,5 @@ uid [ultimate] Thomas Ryder (TEJR) <tejr@cpan.org> uid [ultimate] Thomas Ryder <tyrmored@inspire.net.nz> uid [ultimate] Thomas Ryder <tej.ryder@gmail.com> sub rsa4096 2013-03-12 [E] [expires: 2020-07-31] - 9DF1 A89F F8D9 70AF 3265 C882 96C2 CD91 E67A C61D sub rsa4096 2013-03-12 [S] [expires: 2020-07-31] - 3179 90A1 4597 A1FC F82D 953A B5AF 5F89 2592 6609 sub rsa4096 2019-08-06 [A] [expires: 2020-07-31] - 42AE 569D 6162 7C52 03B0 74ED D58F F1F0 7E90 9B49 diff --git a/gnupg/gpg.conf b/gnupg/gpg.conf deleted file mode 100644 index 97c1ca77..00000000 --- a/gnupg/gpg.conf +++ /dev/null @@ -1,14 +0,0 @@ -# Assume I mean to encrypt to myself if no recipient is specified -default-recipient-self - -# Don't use key IDs in listings, just show full fingerprints -keyid-format none - -# Suppress the copyright message -no-greeting - -# Don't sign pictures or other binary UID data -only-sign-text-ids - -# Show fingerprints where they might not otherwise appear -with-fingerprint diff --git a/mutt/filters/markdown-to-html.sh b/mutt/filters/markdown-to-html.sh new file mode 100644 index 00000000..cdba8ace --- /dev/null +++ b/mutt/filters/markdown-to-html.sh @@ -0,0 +1,7 @@ +printf 'text/html\n\n' +sed 's/ $/ /;/[^ ]$/s/$/ /;s/^-- $/-- /' | +pandoc \ + --from markdown_strict+smart \ + --metadata=pagetitle:HTML \ + --standalone \ + --to html4 diff --git a/mutt/muttrc b/mutt/muttrc index bd244f8a..da13f3f8 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -26,51 +26,6 @@ set beep_new # unset confirmappend -# Use the GPGME library for PGP; sign replies to messages that are themselves -# signed (whether encrypted or not), and encrypt when we have a key for every -# recipient (opportunistic). -# -set crypt_use_gpgme -set crypt_opportunistic_encrypt -set crypt_replysign -set crypt_replysignencrypted - -# Use a default key for self-encrypting both sent and draft messages so that -# they're protected but legible. This defaults to the GPG_KEYID environment -# variable, so be careful to set that lest you send useless OpenPGP headers! -# My kingdom for muttrc(5) conditionals... -# -set pgp_default_key = $GPG_KEYID -set pgp_self_encrypt -set postpone_encrypt - -# Always include OpenPGP header with the selected default key, regardless of -# whether the message is protected or not: -# -# <https://datatracker.ietf.org/doc/draft-josefsson-openpgp-mailnews-header/> -# -# This RFC has expired and doesn't seem to have seen widespread adoption, but -# it seems that Thunderbird's Enigmail extension is still sending key IDs with -# it, and it doesn't do any harm. -# -my_hdr OpenPGP: id=$pgp_default_key\; \ -preference=signencrypt\; \ -url=https://keyserver.pgp.com/vkd/DownloadKey.event?keyid=0x$pgp_default_key - -# Because I (personally) never want to encrypt mail without signing it, add in -# a hook for sending or changing a message that forces a signature if it's -# encrypted but not signed. This may not suit anyone else reading. -# -send-hook '~G !~g' 'push <pgp-menu>s' -send2-hook '~G !~g' 'push <pgp-menu>s' - -# Because of the order in which opportunistic encryption is applied, we queue -# up a no-op change by opening the PGP menu and then doing nothing (pressing -# Enter), to trigger send2-hooks to run and turn signatures on if opportunistic -# encryption happens to have decided to switch encryption on. -# -send-hook '!~G !~g' 'push <pgp-menu><enter>' - # Default to a subject format for forwarded messages that's more familiar to # most mail users, unless sending mail to a list where they're more likely to # appreciate the nicer default that uses square brackets and the author email @@ -83,14 +38,16 @@ send-hook ~l \ # Cache message headers for speed; this really helps. # -set header_cache = '~/.cache/mutt/headers' +set header_cache \ + = ~/.cache/mutt/headers # Save command history; this saves other kinds of history as well, but all # I really want is to be able to run the same commands again even after I quit # Mutt. We can afford to keep 2^8 of these, since it's the future and all. # +set history_file = \ + ~/.cache/mutt/history set history = 256 -set history_file = ~/.cache/mutt/history set save_history = $history # Always put a quoted copy of the whole message in a reply text for me to chop @@ -153,6 +110,71 @@ set reflow_wrap = 0 # unset wait_key +# Use the GPGME library for PGP; sign replies to messages that are themselves +# signed (whether encrypted or not), and encrypt when we have a key for every +# recipient (opportunistic). +# +set crypt_use_gpgme +set crypt_opportunistic_encrypt +set crypt_replysign +set crypt_replysignencrypted + +# Use a default key for self-encrypting both sent and draft messages so that +# they're protected but legible. This defaults to the GPG_KEYID environment +# variable, so be careful to set that lest you send useless OpenPGP headers! +# My kingdom for muttrc(5) conditionals... +# +set pgp_default_key = $GPG_KEYID +set pgp_self_encrypt +set postpone_encrypt + +# Always include OpenPGP header with the selected default key, regardless of +# whether the message is protected or not: +# +# <https://datatracker.ietf.org/doc/draft-josefsson-openpgp-mailnews-header/> +# +# This RFC has expired and doesn't seem to have seen widespread adoption, but +# it looks like Thunderbird's Enigmail extension is still sending key IDs with +# it, and it doesn't do any harm. +# +my_hdr OpenPGP: id=$pgp_default_key\; \ +preference=signencrypt\; \ +url=https://keyserver.pgp.com/vkd/DownloadKey.event?keyid=0x$pgp_default_key +unignore OpenPGP: + +# Because I (personally) never want to encrypt mail without signing it, add in +# a hook for sending or changing a message that forces a signature if it's +# encrypted but not signed. This may not suit anyone else reading. +# +send-hook '~G !~g' 'push <pgp-menu>s' +send2-hook '~G !~g' 'push <pgp-menu>s' + +# Because of the order in which opportunistic encryption is applied, we queue +# up a no-op change by opening the PGP menu and then doing nothing (pressing +# Enter), to trigger send2-hooks to run and turn signatures on if opportunistic +# encryption happens to have decided to switch encryption on. +# +send-hook '!~G !~g' 'push <pgp-menu><enter>' + +# Failing all of the above, maybe autocrypt will passively give us a key to +# use, but don't store its keys in our primary keyring. +# +set autocrypt +set autocrypt_dir \ + = ~/.local/share/mutt/autocrypt + +# Set custom filter to generate an HTML part for plain-text messages in +# Markdown style; defaults to off, per God's will and common decency +# +set send_multipart_alternative_filter \ + = ~/.local/libexec/mutt/filters/markdown-to-html + +# Toggle multipart sending option manually and display the new setting +macro generic,index,browser,pager \\h '\ +<enter-command>toggle send_multipart_alternative<enter>\ +<enter-command>set ?send_multipart_alternative<enter>' \ + 'Toggle multipart/alternative sending' + # Save message to whatever box Mutt guesses, without confirmation macro index,pager S \ '<save-message><enter>' \ |