diff --git a/.config/mutt/headers b/.config/mutt/headers new file mode 100644 index 00000000..519128c9 Binary files /dev/null and b/.config/mutt/headers differ diff --git a/.config/mutt/mailcap b/.config/mutt/mailcap new file mode 100644 index 00000000..4360c905 --- /dev/null +++ b/.config/mutt/mailcap @@ -0,0 +1,4 @@ +text/html; librewolf %s; test=test -n "$display"; needsterminal; +text/html; links copiousoutput; +text/plain; cat %s; copiousoutput +application/pdf; librewolf %s; test=test -n "$display"; needsterminal; diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc new file mode 100644 index 00000000..e97163a1 --- /dev/null +++ b/.config/mutt/muttrc @@ -0,0 +1,219 @@ +# Config largely taken from: +# https://seniormars.github.io/posts/neomutt/#initial-mutt-configuration + +# User +set from = "mosssap@gmail.com" +set realname = "Brian Hayes" + +# Gmail +set imap_user = "mosssap@gmail.com" +set smtp_url = "smtps://mosssap@gmail.com@smtp.gmail.com:465/" +set smtp_authenticators = 'gssapi:login' +source "gpg -dq $XDG_CONFIG_HOME/mutt/passwords.gpg |" + +# Ensure TLS is enforced +set ssl_starttls = yes +set ssl_force_tls = yes + +# My mailboxes +set folder = "imaps://imap.gmail.com:993/[Gmail]" +# set spoolfile = "+All Mail" +set spoolfile = "+Important" +set postponed = "+Drafts" +set record = "+Sent Mail" +set trash = "+Trash" + +mailboxes =Important =Starred =Drafts ="Sent Mail" =Spam =Trash + +# Where to put the stuff +set header_cache = "$XDG_CONFIG_HOME/mutt/headers" +set message_cachedir = "$XDG_CONFIG_HOME/mutt/bodies" +set certificate_file = "$XDG_CONFIG_HOME/mutt/certificates" +set signature = "$XDG_CONFIG_HOME/mutt/signature" + +# Editor +set editor = "nvim" + +# settings +set pager_index_lines = 10 +set pager_context = 3 # show 3 lines of context +set pager_stop # stop at end of message +set menu_scroll # scroll menu +set tilde # use ~ to pad mutt +set move=no # don't move messages when marking as read +set mail_check = 30 # check for new mail every 30 seconds +set imap_keepalive = 900 # 15 minutes +set sleep_time = 0 # don't sleep when idle +set wait_key = no # mutt won't ask "press key to continue" +set envelope_from # which from? +set edit_headers # show headers when composing +set fast_reply # skip to compose when replying +set askcc # ask for CC: +set fcc_attach # save attachments with the body +set forward_format = "Fwd: %s" # format of subject when forwarding +set forward_decode # decode when forwarding +set forward_quote # include message in forwards +set mime_forward # forward attachments as part of body +set attribution = "On %d, %n wrote:" # format of quoting header +set reply_to # reply to Reply to: field +set reverse_name # reply as whomever it was to +set include # include message in replies +set text_flowed=yes # correct indentation for plain text +unset sig_dashes # no dashes before sig +unset markers + +# Sort by newest conversation first. +set charset = "utf-8" +set uncollapse_jump +set sort_re +set sort = reverse-threads +set sort_aux = last-date-received +# How we reply and quote emails. +set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" +set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+" +set send_charset = "utf-8:iso-8859-1:us-ascii" # send in utf-8 + +#sidebar +set sidebar_visible # comment to disable sidebar by default +set sidebar_width = 23 +set sidebar_short_path +set sidebar_folder_indent +# set sidebar_format = "%B %* [%?N?%N / ?%S]" +set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?' +set sidebar_short_path = yes +set sidebar_next_new_wrap = yes +set mail_check_stats +bind index,pager \CK sidebar-prev +bind index,pager \CJ sidebar-next +bind index,pager \CE sidebar-open +bind index,pager B sidebar-toggle-visible + +# Vim keybindings +# macro index A \ + # "~NN." \ + # "mark all new as read" + +bind index j next-entry +bind index k previous-entry +bind pager j next-line +bind pager k previous-line + +bind attach,index,pager \CD next-page +bind attach,index,pager \CU previous-page +bind pager g top +bind pager G bottom +bind attach,index g first-entry +bind attach,index G last-entry + +# link to mailcap file +set mailcap_path = "$XDG_CONFIG_HOME/mutt/mailcap" +# open attachments with mailcap with +bind attach view-mailcap +# save attachments to a folder +macro attach s ' ~/Documents/attachments/' 'save attachment' +auto_view text/html # automatically show html (mailcap uses lynx) +alternative_order text/plain text/enriched text/html # save HTML for last + +# for use with urls (requires urlscan) +macro index,pager \cb " urlscan" "call urlscan to extract URLs out of a message" +macro attach,compose \cb " urlscan" "call urlscan to extract URLs out of a message" + +# Use GPGME +# Use my key for signing and encrypting +set pgp_default_key = 49EDE10574AFE8AB90A8F6C2D5D3C6708DEBFFFB + +# Use GPGME +set crypt_use_gpgme = yes + +# Automatically sign all out-going email +set crypt_autosign = yes + +# Sign replies to signed emails +set crypt_replysign = yes + +# Encrypt replies to encrypted emails +set crypt_replyencrypt = yes + +# Encrypt and sign replies to encrypted and signed email +set crypt_replysignencrypted = yes + +# Attempt to verify signatures automatically +set crypt_verify_sig = yes + +# Attempt to encrypt automatically, if possible +# I would recommend setting this to no as university often have spam filters +# And this will cause your emails to be marked as spam +# as they can't decrypt your emails LMAO +set crypt_opportunistic_encrypt = no + +# So you can view encrypted emails automatically +auto_view application/pgp-encrypted + +# Custom Nord theme +# color normal default default # default colours +color normal brightblue default # default colours +color index brightblue default ~N # new messages +color index red default ~F # flagged messages +color index blue default ~T # tagged messages +color index brightred default ~D # deleted messages +color body brightgreen default (https?|ftp)://[\-\.+,/%~_:?&=\#a-zA-Z0-9]+ # links +color body brightgreen default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email-addresses +color attachment magenta default # attachments +color signature brightwhite default # sigs +color search brightred black # highlight results + +# color indicator black cyan # currently highlighted message +color indicator brightyellow black # currently highlighted message +color error red default # error messages +# color status white brightblack # status line +# color status white cyan # status line +color status brightblue black # status line +# color tree white default # thread tree arrows +color tree brightblack default # thread tree +color tilde cyan default # blank line padding + +color hdrdefault brightblue default # default headers +color header cyan default "^From:" +color header cyan default "^Subject:" + +color quoted cyan default # quote colours +color quoted1 brightcyan default +color quoted2 blue default +color quoted3 green default +color quoted4 yellow default +color quoted5 red default +color message white default +# color body green default "^gpg: Good signature from" +# color body brightred default "^gpg: Bad signature from" +# color body brightred default "^gpg: BAD signature from" +# color body brightred default "^gpg: Note: This key has expired!" +# color body brightyellow default "^gpg: WARNING: This key is not certified with a trusted signature!" +# color body brightyellow default "^gpg: There is no indication that the signature belongs to the owner." +# color body brightyellow default "^gpg: can't handle these multiple signatures" +# color body brightyellow default "^gpg: signature verification suppressed" +# color body brightyellow default "^gpg: invalid node with packet of type" + +# Copied from Luke Smith +set date_format="%y/%m/%d %I:%M%p" +set sort = 'reverse-date' +set markers = no # Disables the `+` displayed at line wraps +set mark_old = no # Unread mail stay unread until read + +# macro index,pager gi "=INBOX" "go to inbox" +# macro index,pager Mi ";=INBOX" "move mail to inbox" +# macro index,pager Ci ";=INBOX" "copy mail to inbox" +# macro index,pager gd "=Drafts" "go to drafts" +# macro index,pager Md ";=Drafts" "move mail to drafts" +# macro index,pager Cd ";=Drafts" "copy mail to drafts" +# macro index,pager gj "=Junk" "go to junk" +# macro index,pager Mj ";=Junk" "move mail to junk" +# macro index,pager Cj ";=Junk" "copy mail to junk" +# macro index,pager gt "=Trash" "go to trash" +# macro index,pager Mt ";=Trash" "move mail to trash" +# macro index,pager Ct ";=Trash" "copy mail to trash" +# macro index,pager gs "=Sent" "go to sent" +# macro index,pager Ms ";=Sent" "move mail to sent" +# macro index,pager Cs ";=Sent" "copy mail to sent" +# macro index,pager ga "=Archive" "go to archive" +# macro index,pager Ma ";=Archive" "move mail to archive" +# macro index,pager Ca ";=Archive" "copy mail to archive" diff --git a/.config/mutt/passwords.gpg b/.config/mutt/passwords.gpg new file mode 100644 index 00000000..f6bdbbe5 Binary files /dev/null and b/.config/mutt/passwords.gpg differ diff --git a/.config/mutt/signature b/.config/mutt/signature new file mode 100644 index 00000000..3278d73e --- /dev/null +++ b/.config/mutt/signature @@ -0,0 +1 @@ +"I serve you best when I have utterly forgotten you, and you likewise serve me best when you have utterly forgotten me. But even so, why should you repine? Even if you forget the old me, I will still possess something that cannot be forgotten!"-Zhuangzi diff --git a/aliases b/aliases index 8f4fe5a6..2bb2b59c 100644 --- a/aliases +++ b/aliases @@ -243,6 +243,7 @@ alias taze="npx taze" alias pip_upgrade="python -m pip install --upgrade pip" alias rust_upgrade="rustup update" alias nb="newsboat" +alias {mutt,nmut,nmutt}="neomutt" alias {mnb,nb-m}="cd ~/.config/newsboat && /usr/bin/cp $HOME/.config/newsboat/my_urls $HOME/.config/newsboat/urls && newsboat" alias {ynb,nb-y}="/usr/bin/cp $HOME/.config/newsboat/yt_urls $HOME/.config/newsboat/urls && newsboat" alias {rnb,nb-r}="cd ~/.config/newsboat && /usr/bin/cp $HOME/.config/newsboat/reddit_urls $HOME/.config/newsboat/urls && newsboat" diff --git a/neomutt_basics.txt b/neomutt_basics.txt new file mode 100644 index 00000000..0f6c0068 --- /dev/null +++ b/neomutt_basics.txt @@ -0,0 +1,22 @@ +I've set up basic vim keybindings with a few caveats in neomutt, otherwise +either use the native keybindings, or consult where you got your config from: + +https://seniormars.github.io/posts/neomutt/#initial-mutt-configuration + +Shift + B Toggle Tree +Ctrl + J Go UP Tree +Ctrl + K Go DOWN Tree +Ctrl + E Open Up Selected Mail Folder in Tree + +Standard Vim keybindings: +gg Go to top of email listing +Shift + G go to bottom of email listing +Ctrl + D next page +Ctrl + U previous page + +ENTER Open selected email +Ctrl + B use mailcap to open up html/urls (use if you can't see anything) +While in this mailcap menu, you can navigate links and open it up in your +browser. + +You can select certain elements and also use 'm' to open them up as well. diff --git a/updates.txt b/updates.txt index d6f6cba8..b60995ae 100644 --- a/updates.txt +++ b/updates.txt @@ -220,4 +220,5 @@ And thunderbird doas pacman -S firefox thunderbird Install cloc (counts lines of code from terminal): -doas pacman -S cloc +neomutt and urlscan +doas pacman -S cloc neomutt urlscan