diff --git a/bootstrap/packages.txt b/bootstrap/packages.txt index 1ebd8d5..7732656 100644 --- a/bootstrap/packages.txt +++ b/bootstrap/packages.txt @@ -1,7 +1,6 @@ # zsh plugins acpid activitywatch-bin -aerc afew alacritty alias-tips-git @@ -106,6 +105,7 @@ mpv mpv-mpris nano needrestart +neomutt neovim neovim-nightly nerd-fonts-fira-code diff --git a/mail/.config/aerc/accounts.conf b/mail/.config/aerc/accounts.conf deleted file mode 100644 index 264c7ef..0000000 --- a/mail/.config/aerc/accounts.conf +++ /dev/null @@ -1,9 +0,0 @@ -[Personal] -source = notmuch://~/documents/mail -outgoing = smtp+plain://marty.oehme%40gmail.com@smtp.gmail.com:587 -outgoing-cred-cmd = pass 'misc/aerc-gmail-app-password' | head -1 -default = Inbox -smtp-starttls = yes -from = Marty Oehme -copy-to = Sent -query-map = ~/.config/aerc/notmuch-querymap diff --git a/mail/.config/aerc/aerc.conf b/mail/.config/aerc/aerc.conf deleted file mode 100644 index d7effe8..0000000 --- a/mail/.config/aerc/aerc.conf +++ /dev/null @@ -1,191 +0,0 @@ -# -# aerc main configuration - -[ui] -# -# Describes the format for each row in a mailbox view. This field is compatible -# with mutt's printf-like syntax. -# -# Default: %D %-17.17n %Z %s -index-format=%D %-30.30n %Z %s - -# -# See time.Time#Format at https://godoc.org/time#Time.Format -# -# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) -# timestamp-format=2006-01-02 03:04 PM -timestamp-format=06 Mon Jan 02 15:04 - -# -# Width of the sidebar, including the border. -# -# Default: 20 -sidebar-width=20 - -# -# Message to display when viewing an empty folder. -# -# Default: (no messages) -empty-message=(no messages) - -# Message to display when no folders exists or are all filtered -# -# Default: (no folders) -empty-dirlist=(no folders) - -# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel -# -# Default: false -mouse-enabled=true - -# -# Ring the bell when new messages are received -# -# Default: true -new-message-bell=true - -# Marker to show before a pinned tab's name. -# -# Default: ` -pinned-tab-marker='`' - -# Describes the format string to use for the directory list -# -# Default: %n %>r -dirlist-format=%n %>r - -# List of space-separated criteria to sort the messages by, see *sort* -# command in *aerc*(1) for reference. Prefixing a criterion with "-r " -# reverses that criterion. -# -# Example: "from -r date" -# -# Default: "" -sort=-r date - -# Moves to next message when the current message is deleted -# -# Default: true -next-message-on-delete=true - -[viewer] -# -# Specifies the pager to use when displaying emails. Note that some filters -# may add ANSI codes to add color to rendered emails, so you may want to use a -# pager which supports ANSI codes. -# -# Default: less -R -pager=less -R - -# -# If an email offers several versions (multipart), you can configure which -# mimetype to prefer. For example, this can be used to prefer plaintext over -# html emails. -# -# Default: text/plain,text/html -alternatives=text/plain,text/html - -# -# Default setting to determine whether to show full headers or only parsed -# ones in message viewer. -# -# Default: false -show-headers=false - -# -# Layout of headers when viewing a message. To display multiple headers in the -# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if -# none of their specified headers are present in the message. -# -# Default: From|To,Cc|Bcc,Date,Subject -header-layout=From|To,Cc|Bcc,Date,Subject - -# Whether to always show the mimetype of an email, even when it is just a single part -# -# Default: false -always-show-mime=false - -# How long to wait after the last input before auto-completion is triggered. -# -# Default: 250ms -completion-delay=0ms - -# -# Global switch for completion popovers -# -# Default: true -completion-popovers=true - -[compose] -# -# Specifies the command to run the editor with. It will be shown in an embedded -# terminal, though it may also launch a graphical window if the environment -# supports it. Defaults to $EDITOR, or vi. -editor= - -# -# Default header fields to display when composing a message. To display -# multiple headers in the same row, separate them with a pipe, e.g. "To|From". -# -# Default: To|From,Subject -header-layout=To|From,Subject,Cc|Bcc - -# -# Specifies the command to be used to tab-complete email addresses. Any -# occurrence of "%s" in the address-book-cmd will be replaced with what the -# user has typed so far. -# -# The command must output the completions to standard output, one completion -# per line. Each line must be tab-delimited, with an email address occurring as -# the first field. Only the email address field is required. The second field, -# if present, will be treated as the contact name. Additional fields are -# ignored. -address-book-cmd=mail-searchcontacts %s - -[filters] -# -# Filters allow you to pipe an email body through a shell command to render -# certain emails differently, e.g. highlighting them with ANSI escape codes. -# -# The first filter which matches the email's mimetype will be used, so order -# them from most to least specific. -# -# You can also match on non-mimetypes, by prefixing with the header to match -# against (non-case-sensitive) and a comma, e.g. subject,text will match a -# subject which contains "text". Use header,~regex to match against a regex. -subject,~^\[PATCH=awk -f /usr/share/aerc/filters/hldiff -text/html=/usr/share/aerc/filters/html -text/*=awk -f /usr/share/aerc/filters/plaintext -image/*=feh - -application/pdf=zathura - - -[triggers] -# -# Triggers specify commands to execute when certain events occur. -# -# Example: -# new-email=exec notify-send "New email from %n" "%s" - -# -# Executed when a new email arrives in the selected folder -new-email= - -[templates] -# Templates are used to populate email bodies automatically. -# - -# The directories where the templates are stored. It takes a colon-separated -# list of directories. -# -# default: /usr/share/aerc/templates/ -template-dirs=/usr/share/aerc/templates/ - -# The template to be used for quoted replies. -# -# default: quoted_reply -quoted-reply=quoted_reply - -# The template to be used for forward as body. -# -# default: forward_as_body -forwards=forward_as_body diff --git a/mail/.config/aerc/binds.conf b/mail/.config/aerc/binds.conf deleted file mode 100644 index c2cdec0..0000000 --- a/mail/.config/aerc/binds.conf +++ /dev/null @@ -1,115 +0,0 @@ -# Binds are of the form = -# To use '=' in a key sequence, substitute it with "Eq": "" -# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit -gT = :prev-tab -gt = :next-tab - = :term -gR = :exec mail-check - -[messages] -q = :quit - -j = :next - = :next - = :next 50% - = :next 100% - = :next -s 100% - -k = :prev - = :prev - = :prev 50% - = :prev 100% - = :prev -s 100% -gg = :select 0 -G = :select -1 - -c = :cf - = :next-folder - = :prev-folder -'' = :cf Inbox -'i = :cf Important -'a = :cf Archive -'A = :cf All -'s = :cf Sent -'t = :cf Trash - -v = :mark -t -V = :mark -v - - = :view -l = :view -D = :prompt 'Really delete this message?' 'delete-message' -mi = :modify-labels +inbox -dump -deleted -mm = :modify-labels +flagged -mM = :modify-labels -flagged -dd = :modify-labels +deleted -inbox -dump -ma = :modify-labels -inbox -deleted -dump -md = :modify-labels +dump -inbox - -C = :compose - -rr = :reply -a -rq = :reply -aq -Rr = :reply -Rq = :reply -q - -$ = :term -! = :term -| = :pipe - -/ = :search -\ = :filter -n = :next-result -N = :prev-result - -[view] -q = :close -| = :pipe -D = :delete -S = :save -A = :archive flat - -f = :forward -rr = :reply -a -rq = :reply -aq -Rr = :reply -Rq = :reply -q - -H = :toggle-headers - = :prev-part - = :next-part -J = :next -K = :prev - -[compose] -# Keybindings used when the embedded terminal is not selected in the compose -# view -$ex = - = :prev-field - = :next-field - = :next-field - -[compose::editor] -# Keybindings used when the embedded terminal is selected in the compose view -$noinherit = true -$ex = - = :prev-field - = :next-field - = :prev-tab - = :next-tab - -[compose::review] -# Keybindings used when reviewing a message to be sent -y = :send -n = :abort -p = :postpone -q = :abort -e = :edit -a = :attach - -[terminal] -$noinherit = true -$ex = - - = :prev-tab - = :next-tab diff --git a/mail/.config/aerc/notmuch-querymap b/mail/.config/aerc/notmuch-querymap deleted file mode 100644 index 3424713..0000000 --- a/mail/.config/aerc/notmuch-querymap +++ /dev/null @@ -1,7 +0,0 @@ -All=* -Inbox=tag:inbox and not tag:dump -Archive=not tag:inbox and not tag:deleted and not tag:dump -Dump=tag:dump -Trash=tag:deleted -Important=tag:flagged -Sent=from:marty.oehme@gmail.com or from:marty.oehme@googlemail.com or from:moehme@ruc.dk or from:mo82rimu@studserv.uni-leipzig.de diff --git a/mail/.config/isync/mbsyncrc b/mail/.config/isync/mbsyncrc index 9429f5d..d6da236 100644 --- a/mail/.config/isync/mbsyncrc +++ b/mail/.config/isync/mbsyncrc @@ -25,13 +25,44 @@ Inbox ~/documents/mail/Inbox # define generous maximum size to store locally MaxSize 50M -Channel gmail -Far :gmail-remote: -Near :mail-local: +Channel gmail-inbox +Far :gmail-remote:INBOX +Near :mail-local:inbox # Exclude everything under the internal [Gmail] folder, except the interesting folders -Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" "[Gmail]/Trash" -#Patterns * # Automatically create missing mailboxes, both locally and on the server -Create Both +Create Near # Save the synchronization state files in the relevant directory SyncState * + +Channel gmail-sent +Far :gmail-remote:"[Google Mail]/Sent Mail" +Near :mail-local:sent +Create Near + +Channel gmail-trash +Far :gmail-remote:"[Google Mail]/Trash" +Near :mail-local:trash +Create Near + +Channel gmail-important +Far :gmail-remote:"[Google Mail]/Starred" +Near :mail-local:important +Create Near + +Channel gmail-drafts +Far :gmail-remote:"[Google Mail]/Drafts" +Near :mail-local:drafts +Create Near + +Channel gmail-all +Far :gmail-remote:"[Google Mail]/All Mail" +Near :mail-local:archive +Create Near + +# Put all the channels into one group +Group googlemail +Channel gmail-inbox +Channel gmail-important +Channel gmail-sent +Channel gmail-trash +Channel gmail-all diff --git a/mail/.config/neomutt/mailcap b/mail/.config/neomutt/mailcap new file mode 100644 index 0000000..0c8fb9a --- /dev/null +++ b/mail/.config/neomutt/mailcap @@ -0,0 +1,8 @@ +text/html; $BROWSER %s +text/html; w3m -I %{charset} -T text/html -dump; copiousoutput; +video/*; setsid umpv --quiet %s &; copiousoutput +audio/*; mpv %s ; +application/*; mkdir -p /tmp/mutt \; cp %s /tmp/mutt \; xdg-open /tmp/mutt/$(basename %s) & +text/plain; $EDITOR %s ; +application/pgp-encrypted; gpg -d '%s'; copiousoutput; +application/pgp-keys; gpg --import '%s'; copiousoutput; diff --git a/mail/.config/neomutt/neomuttrc b/mail/.config/neomutt/neomuttrc new file mode 100644 index 0000000..2a33a99 --- /dev/null +++ b/mail/.config/neomutt/neomuttrc @@ -0,0 +1,140 @@ +# Identity +# +set realname = "Marty Oehme" +set from = "marty.oehme@gmail.com" +# # If you have another address: +# alternates "^neomutt@example\.com$" +# # Or, if you use the entire domain: +# alternates "@example\.com$" +# set reverse_name + +# Account settings +# local maildir settings +set mbox_type = Maildir +set folder = ~/documents/mail # This has the shortcut '+' or '=' +set spoolfile = "+inbox" # This has the shortcut '!' +set postponed = "+drafts" +set trash = "+trash" +# Disable saving outgoing mail since Gmail saves them by default. +unset record +mailboxes ! \ + "+important" \ + "+sent" \ + "+drafts" \ + "+trash" \ + "+archive" + +set mail_check = 60 +set mail_check_stats + +# Basic settings +set quit # at least for rapid prototyping +unset mark_old # things should only be new/unread or I actually looked at them +set pipe_decode # get rid of headers when passing messages along +set wait_key = no # don't wait for user input after shell cmds, auto-view, piping, etc +# set +set sort_re # thread based on regex below +# set reply_regex = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" + +# display +set sort = threads +set sort_aux = reverse-last-date-received +set date_format = "%z/%m/%d %I:%M%p" +# set date_format = "%m/%d" +set index_format = "%4C [%Z] %{%y/%b %d} %-20.20F %s" +# sidebar view options +set sidebar_visible = yes +set sidebar_width = 18 +set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S" +color sidebar_new color221 color233 +# statusbar view options +set status_chars = " *%A" +set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───" +# pager view options +set pager_index_lines = 5 +set pager_context = 3 +set pager_stop # do not go to next msg if at bottom of pager +set menu_scroll = yes +set tilde # show tildes for blank lines +unset markers # no + markers for wrapped stuff +# hide headers except for those explicitly unignored +ignore * +unignore From To Cc Bcc Date Subject Message-ID +unhdr_order * +unignore From To Cc Bcc Date Subject Message-ID + +# index navigation +bind index,pager g noop # don't send group-replies with g +bind index gg first-entry +bind index G last-entry +bind index collapse-thread +# mailbox navigation +macro index,pager gi "=inbox" "go to inbox" +macro index,pager gm "=important" "go to important" +macro index,pager gs "=sent" "go to sent" +macro index,pager gd "=drafts" "go to drafts" +macro index,pager gt "=trash" "go to trash" +# sidebar navigation +bind index,pager sidebar-next +bind index,pager sidebar-prev +bind index,pager sidebar-open +# bind index,pager \CO sidebar-open +# pager navigation +bind pager k previous-line +bind pager j next-line +bind pager gg top +bind pager G bottom + +# since we unbound the original g +bind index,pager R group-reply +# mark all read +macro index \CN "T~UN." "mark all messages as read" +# open urls found in the e-mail +macro pager \CU "|urlview" "call urlview to open links" + + +# Sync email +macro index O "mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc -a" "refresh all e-mail" +macro index o "mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc gmail-inbox" "refresh inbox e-mail" + +# Saner copy/move dialogs +macro index C "?" "copy a message to a mailbox" +macro index M "?" "move a message to a mailbox" + +# pager settings +# filetypes and mailcap +set mailcap_path = "~/.config/neomutt/mailcap:~/.mailcap:/usr/share/neomutt/mailcap:/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap" + +# Prefer plain text to html. +# However, for brain dead clients that bundle attachments inside a +# multipart/alternative, prefer that alternative. +alternative_order multipart/mixed multipart/related text/plain +alternative_order text/plain text/enriched text/html + +# Consult mime.types for determining types of these attachments +mime_lookup application/octet-stream + +# This requires a ~/.mailcap entry with the copiousoutput flag, such as: +# text/html; lynx -dump -width ${COLUMNS:-80} %s; nametemplate=%s.html; copiousoutput +auto_view text/html + +# Remember to `mkdir -p ~/.neomutt/hcache` first: +set header_cache= "~/.neomutt/hcache" + +############### +# Message composition settings +# +set edit_headers + +# set editor = "emacsclient -a emacs -t" +# set editor = "vim" + +set mime_type_query_command = "xdg-mime query filetype" + +# msmtp is a solid SMTP client. +# neomutt also has built-in SMTP, or you can use an MTA like exim4 or postfix. +set sendmail = "/usr/bin/msmtp" + +# lbdb is a versatile contact query tool. +# Invoke via ctrl-t in an address prompt +set query_command = "/usr/bin/lbdbq" diff --git a/mail/.config/sh/env.d/neomutt-create-cache-dir.sh b/mail/.config/sh/env.d/neomutt-create-cache-dir.sh new file mode 100644 index 0000000..8315879 --- /dev/null +++ b/mail/.config/sh/env.d/neomutt-create-cache-dir.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +# Ensure the neomutt cache directories exist + +[ -d "${XDG_CACHE_HOME:-~/.cache}/neomutt" ] || mkdir -p "${XDG_CACHE_HOME:-~/.cache}/neomutt/hcache"