summaryrefslogtreecommitdiffstats
path: root/.config/mutt
diff options
context:
space:
mode:
authorLuke <luke@lukesmith.xyz>2018-01-21 18:29:48 -0700
committerLuke <luke@lukesmith.xyz>2018-01-21 18:29:48 -0700
commit50adee4e79febf6f74594604e9f7083461b04227 (patch)
tree54036701bd0957e51521e7f51d4d3b49450f22da /.config/mutt
parent68bd2acdc8f8040deab188c748d207d93ba923ca (diff)
downloadeibhear-50adee4e79febf6f74594604e9f7083461b04227.tar.gz
eibhear-50adee4e79febf6f74594604e9f7083461b04227.tar.zst
eibhear-50adee4e79febf6f74594604e9f7083461b04227.zip
"first" commit, preparing for LARBS 2.0
Diffstat (limited to '.config/mutt')
-rw-r--r--.config/mutt/aliases13
-rw-r--r--.config/mutt/email.md40
-rw-r--r--.config/mutt/gmailrc30
-rw-r--r--.config/mutt/mailcap11
-rw-r--r--.config/mutt/muttcol151
-rwxr-xr-x.config/mutt/muttimage.sh8
-rw-r--r--.config/mutt/muttrc41
-rw-r--r--.config/mutt/personalrc23
8 files changed, 317 insertions, 0 deletions
diff --git a/.config/mutt/aliases b/.config/mutt/aliases
new file mode 100644
index 0000000..86a2029
--- /dev/null
+++ b/.config/mutt/aliases
@@ -0,0 +1,13 @@
+#Here you can put email aliases. Here's an example:
+
+alias luke luke@lukesmith.xyz
+
+#When you put "luke" as the recipient in mutt, it will automatically direct it to my email address.
+
+#You can also put multiple emails under one aliases:
+
+alias project_members billy@gmail.com, sally@gmail.com, amanda@gmail.com, chad@gmail.com
+
+#With the above alias, if you put "project_members" as the recipient, mutt will fill in all the emails above as the recipients.
+#
+#This is extremely useful, so take advantage of it!
diff --git a/.config/mutt/email.md b/.config/mutt/email.md
new file mode 100644
index 0000000..a7504fd
--- /dev/null
+++ b/.config/mutt/email.md
@@ -0,0 +1,40 @@
+# Luke's mutt/OfflineIMAP/msmtp/notmuch setup
+
+## My email setup gives you the following:
+
++ A clean, fast and vim-like terminal interface to send and read email (mutt)
++ OfflineIMAP, which takes keep a copy of all of your mail offline, allowing you to read and
++ notmuch as an email indexer, which allows you to easily search email by content within mutt.
++ A looping script which continually uses OfflineIMAP to check mail, and if there is new mail, it will both notify you with a ding and then tell notmuch to quickly index the new mail for searching.
+
+All of these features are well synced together and require just a little setup.
+
+To use my email setup, be sure to have `neomutt`, `offlineimap`, `msmtp` `notmuch` and `notmuch-mutt` installed.
+
+Note that the notification sound will work on i3 by default. You can edit the notification command that runs in `.config/Scripts/check.sh`.
+
+## How to set it up.
+
+To use this setup, you have to add your email settings where required.
+
+There are several steps after which everything should work nicely.
+
++ **First**, open `.offlineimaprc` and add your email account and server info (details are in that file.
++ To index your mail for quick searching, run `notmuch setup` and give your mail directory (`~/.Mail` by default in my configs)
++ Then you can go ahead and start syncing your email by running `offlineimap -o`. This will download your mail from all the accounts you use to `~/.Mail`.
+ + If you want to use my autosync loop script, make sure to check `.config/Scripts/inboxes` to ensure that your inboxes are there.
++ Next, add your email account info to `.msmtprc`.
++ And the same to `.config/mutt/personalrc` or `.config/mutt/gmailrc` or your own rc file.
+ + (mutt will try to load the `gmailrc` by default. You can change this in `.config/mutt/muttrc`.)
+
+## Updating
+
+As I said before, I have a loop script in `.config/Scripts/mailsyncloop.sh` which will run OfflineIMAPs every few minutes and will play a notification sound and run notmuch if new mail is found.
+
+I suggest running this scipt in a tty or tmux session, so you can check up on it if you really want. That's what I do.
+
+## Enjoy your email!
+
+If you're using my i3 config, you can run mutt with `mutt`. Explore the `muttrc` to see my bindings and add your own.
+
+If you're not using my i3 config, you may want to move `muttrc` to `~/.muttrc`, because I keep my `muttrc` in the `.config` directory to different reasons, but it will look only in `~` by default.
diff --git a/.config/mutt/gmailrc b/.config/mutt/gmailrc
new file mode 100644
index 0000000..c86573a
--- /dev/null
+++ b/.config/mutt/gmailrc
@@ -0,0 +1,30 @@
+# vim: filetype=muttrc
+# Gmail app password should be generated for this configuration file. Never use your proper password in a standard text field.
+set imap_user = "YOURNAME@gmail.com"
+set smtp_url = "smtp://YOURNAME@smtp.gmail.com:587/"
+set from = "YOURNAME@gmail.com"
+set realname = "YOUR ACTUAL NAME"
+set mbox_type = Maildir
+set sendmail = "/usr/bin/msmtp -a gmail"
+set folder = "~/.Mail/Gmail"
+set spoolfile = "+INBOX"
+set record = /dev/null
+set mbox = "+[Gmail].All Mail"
+set postponed = "+[Gmail].Drafts"
+set header_cache = ~/.config/mutt/gmail/cache/headers
+set message_cachedir = ~/.config/mutt/gmail/cache/bodies
+set certificate_file = ~/.config/mutt/gmail/certificates
+set ssl_starttls = yes
+set ssl_force_tls = yes
+
+mailboxes +INBOX
+
+bind index g noop
+macro index gi "<change-folder>=INBOX<enter>" "Go to inbox"
+macro index ga "<change-folder>=[Gmail].All Mail<enter>" "Go to all mail"
+macro index gs "<change-folder>=[Gmail].Sent Mail<enter>" "Go to sent mail"
+macro index gS "<change-folder>=[Gmail].Spam<enter>" "Go to spam"
+macro index gt "<change-folder>=[Gmail].Trash<enter>" "Go to trash"
+macro index gd "<change-folder>=[Gmail].Drafts<enter>" "Go to drafts"
+macro index gl "<change-folder>=lingcircle<enter>" "Go to lingcircle"
+macro index gr "<change-folder>=ugaroml<enter>" "Go to ugaroml"
diff --git a/.config/mutt/mailcap b/.config/mutt/mailcap
new file mode 100644
index 0000000..0e8631e
--- /dev/null
+++ b/.config/mutt/mailcap
@@ -0,0 +1,11 @@
+#text/html; qutebrowser %s &; test=test -n "$DISPLAY"; needsterminal;
+
+text/html; w3m -I %{charset} -T text/html; copiousoutput;
+#text/html; mv %s %s.html && qutebrowser %s.html > /dev/null; needsterminal;
+#
+application/pdf; mv %s %s.pdf && mupdf %s.pdf > /dev/null; needsterminal;
+
+image/*; ~/.config/mutt/muttimage.sh %s ; copiousoutput
+
+#application/pdf; pdftotext '%s' -; copiousoutput; description=PDF Document;
+#nametemplate=%s.pdf
diff --git a/.config/mutt/muttcol b/.config/mutt/muttcol
new file mode 100644
index 0000000..e9d6def
--- /dev/null
+++ b/.config/mutt/muttcol
@@ -0,0 +1,151 @@
+# vim: filetype=muttrc
+
+#
+#
+# make sure that you are using mutt linked against slang, not ncurses, or
+# suffer the consequences of weird color issues. use "mutt -v" to check this.
+
+# custom body highlights -----------------------------------------------
+# highlight my name and other personally relevant strings
+#color body yellow default "(ethan|schoonover)"
+# custom index highlights ----------------------------------------------
+# messages which mention my name in the body
+#color index yellow default "~b \"phil(_g|\!| gregory| gold)|pgregory\" !~N !~T !~F !~p !~P"
+#color index J_cream brightwhite "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~N !~T !~F !~p !~P"
+#color index yellow cyan "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~T !~F !~p !~P"
+#color index yellow J_magent "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~F !~p !~P"
+## messages which are in reference to my mails
+#color index J_magent default "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" !~N !~T !~F !~p !~P"
+#color index J_magent brightwhite "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~N !~T !~F !~p !~P"
+#color index J_magent cyan "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~T !~F !~p !~P"
+#color index J_magent red "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~F !~p !~P"
+
+# for background in 16 color terminal, valid background colors include:
+# base03, bg, black, any of the non brights
+
+# basic colors ---------------------------------------------------------
+color normal brightyellow default
+color error red default
+color tilde black default
+color message cyan default
+color markers red white
+color attachment white default
+color search brightmagenta default
+#color status J_black J_status
+color status brightyellow black
+color indicator brightblack yellow
+color tree yellow default # arrow in threads
+
+# basic monocolor screen
+mono bold bold
+mono underline underline
+mono indicator reverse
+mono error bold
+
+# index ----------------------------------------------------------------
+
+#color index red default "~D(!~p|~p)" # deleted
+#color index black default ~F # flagged
+#color index brightred default ~= # duplicate messages
+#color index brightgreen default "~A!~N!~T!~p!~Q!~F!~D!~P" # the rest
+#color index J_base default "~A~N!~T!~p!~Q!~F!~D" # the rest, new
+color index red default "~A" # all messages
+color index brightred default "~E" # expired messages
+color index blue default "~N" # new messages
+color index blue default "~O" # old messages
+color index brightmagenta default "~Q" # messages that have been replied to
+color index brightgreen default "~R" # read messages
+color index blue default "~U" # unread messages
+color index blue default "~U~$" # unread, unreferenced messages
+color index brightyellow default "~v" # messages part of a collapsed thread
+color index brightyellow default "~P" # messages from me
+color index cyan default "~p!~F" # messages to me
+color index cyan default "~N~p!~F" # new messages to me
+color index cyan default "~U~p!~F" # unread messages to me
+color index brightgreen default "~R~p!~F" # messages to me
+color index red default "~F" # flagged messages
+color index red default "~F~p" # flagged messages to me
+color index red default "~N~F" # new flagged messages
+color index red default "~N~F~p" # new flagged messages to me
+color index red default "~U~F~p" # new flagged messages to me
+color index black red "~D" # deleted messages
+color index brightcyan default "~v~(!~N)" # collapsed thread with no unread
+color index yellow default "~v~(~N)" # collapsed thread with some unread
+color index green default "~N~v~(~N)" # collapsed thread with unread parent
+# statusbg used to indicated flagged when foreground color shows other status
+# for collapsed thread
+color index red black "~v~(~F)!~N" # collapsed thread with flagged, no unread
+color index yellow black "~v~(~F~N)" # collapsed thread with some unread & flagged
+color index green black "~N~v~(~F~N)" # collapsed thread with unread parent & flagged
+color index green black "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged
+color index cyan black "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly
+color index yellow red "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial)
+#color index yellow default "~(~N)" # messages in threads with some unread
+#color index green default "~S" # superseded messages
+#color index red default "~T" # tagged messages
+#color index brightred red "~=" # duplicated messages
+
+# message headers ------------------------------------------------------
+
+#color header brightgreen default "^"
+color hdrdefault brightgreen default
+color header brightyellow default "^(From)"
+color header blue default "^(Subject)"
+
+# body -----------------------------------------------------------------
+
+color quoted blue default
+color quoted1 cyan default
+color quoted2 yellow default
+color quoted3 red default
+color quoted4 brightred default
+
+color signature brightgreen default
+color bold black default
+color underline black default
+color normal default default
+#
+color body brightcyan default "[;:][-o][)/(|]" # emoticons
+color body brightcyan default "[;:][)(|]" # emoticons
+color body brightcyan default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\
+ |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\
+ |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?"
+color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
+color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
+
+## pgp
+
+color body red default "(BAD signature)"
+color body cyan default "(Good signature)"
+color body brightblack default "^gpg: Good signature .*"
+color body brightyellow default "^gpg: "
+color body brightyellow red "^gpg: BAD signature from.*"
+mono body bold "^gpg: Good signature"
+mono body bold "^gpg: BAD signature from.*"
+
+# yes, an insance URL regex
+color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
+# and a heavy handed email regex
+#color body J_magent default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])"
+
+# Various smilies and the like
+#color body brightwhite default "<[Gg]>" # <g>
+#color body brightwhite default "<[Bb][Gg]>" # <bg>
+#color body yellow default " [;:]-*[})>{(<|]" # :-) etc...
+# *bold*
+#color body blue default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
+#mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
+# _underline_
+#color body blue default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
+#mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
+# /italic/ (Sometimes gets directory names)
+#color body blue default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
+#mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
+
+# Border lines.
+#color body blue default "( *[-+=#*~_]){6,}"
+
+#folder-hook . "color status J_black J_status "
+#folder-hook gmail/inbox "color status J_black yellow "
+#folder-hook gmail/important "color status J_black yellow "
+
diff --git a/.config/mutt/muttimage.sh b/.config/mutt/muttimage.sh
new file mode 100755
index 0000000..b67de83
--- /dev/null
+++ b/.config/mutt/muttimage.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+#### Determine size of Terminal
+height=`stty size | awk 'BEGIN {FS = " "} {print $1;}'`
+width=`stty size | awk 'BEGIN {FS = " "} {print $2;}'`
+
+### Display Image / offset with mutt bar
+echo -e "2;3;\n0;1;210;20;$((width*7-250));$((height*14-100));0;0;0;0;$1\n4;\n3;" | /usr/lib/w3m/w3mimgdisplay &
diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc
new file mode 100644
index 0000000..8341228
--- /dev/null
+++ b/.config/mutt/muttrc
@@ -0,0 +1,41 @@
+source ~/.config/mutt/gmailrc
+source ~/.config/mutt/muttcol
+source ~/.config/mutt/aliases
+
+set sort = 'reverse-date'
+set editor = vim
+#set copy = no
+set timeout = "5"
+set mail_check = "10"
+set mailcap_path = ~/.config/mutt/mailcap
+set date_format="%m/%d %I:%M"
+set index_format="%2C %Z %d %-15.15F %s (%-4.4c)"
+
+auto_view text/html
+alternative_order text/plain text/enriched text/html
+
+mono bold bold
+mono underline underline
+mono indicator reverse
+color index yellow default '.*'
+color index_author red default '.*'
+color index_number blue default
+color index_subject cyan default '.s'
+color index_size green default
+color normal default default
+color body brightred default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+
+color body brightblue default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+
+
+bind editor <space> noop
+bind index G last-entry
+bind index gg first-entry
+bind index d half-down
+bind index u half-up
+bind index D delete-message
+bind index U undelete-message
+bind index F search
+bind index R group-reply
+
+auto_view application/pdf
+
+macro index,pager U "<enter-command>set pipe_decode = yes<enter><pipe-message>urlview<enter><enter-command>set pipe_decode = no<enter>""view URLs"
diff --git a/.config/mutt/personalrc b/.config/mutt/personalrc
new file mode 100644
index 0000000..a372456
--- /dev/null
+++ b/.config/mutt/personalrc
@@ -0,0 +1,23 @@
+# vim: filetype=muttrc
+set imap_user = "YOU@YOURDOMAIN.COM"
+set smtp_url = "SMTPSERVERINFO:PORT"
+set realname = "YOUR NAME"
+set mbox_type = Maildir
+set sendmail = "/usr/bin/msmtp -a personal"
+set folder = "~/.Mail/Personal"
+set spoolfile = +INBOX
+set record = +INBOX.Sent
+set postponed = +INBOX.Drafts
+set header_cache = ~/.config/mutt/Personal/cache/headers
+set message_cachedir = ~/.config/mutt/Personal/cache/bodies
+set certificate_file = ~/.config/mutt/Personal/certificates
+set ssl_starttls = yes
+set ssl_force_tls = yes
+
+bind index g noop
+bind index gg first-entry
+macro index gi "<change-folder>=INBOX<enter>" "Go to inbox"
+macro index gs "<change-folder>=INBOX.Sent<enter>" "Go to sent"
+macro index gd "<change-folder>=INBOX.Drafts<enter>" "Go to drafts"
+macro index gj "<change-folder>=INBOX.Junk<enter>" "Go to junk"
+macro index gt "<change-folder>=INBOX.Trash<enter>" "Go to trash"