aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaster4385 <venkatesh@tablaster.dev>2024-12-01 00:08:36 +0530
committerBlaster4385 <venkatesh@tablaster.dev>2024-12-01 00:08:36 +0530
commit354496635ea960960d43dfeab8eee9d8341edd89 (patch)
tree6e47f334d0ac45002235cdeffe0c363a42c4cebd
parent1f825cbc5e545f1e3df14af2b7b0d244e930c764 (diff)
feat: added neomutt config
-rw-r--r--.dotter/global.toml3
-rw-r--r--.dotter/local.toml1
-rw-r--r--.dotter/pre_deploy.sh2
-rw-r--r--neomutt/accounts/venkatesh@tablaster.dev.muttrc21
-rw-r--r--neomutt/colors69
-rw-r--r--neomutt/mailcap9
-rw-r--r--neomutt/mappings80
-rw-r--r--neomutt/neomuttrc7
-rw-r--r--neomutt/openfile9
-rw-r--r--neomutt/settings34
10 files changed, 234 insertions, 1 deletions
diff --git a/.dotter/global.toml b/.dotter/global.toml
index 265953e..24ae7c1 100644
--- a/.dotter/global.toml
+++ b/.dotter/global.toml
@@ -22,6 +22,9 @@ depends = []
[mpd.files]
"mpd" = "~/.config/mpd"
+[neomutt.files]
+"neomutt" = "~/.config/neomutt"
+
[nvim.files]
"nvim/nvchad" = {target = "~/.config/nvim/", type = "symbolic"}
"nvim/custom" = {target = "~/.config/nvim/lua/custom/", type = "symbolic"}
diff --git a/.dotter/local.toml b/.dotter/local.toml
index 40d68fe..1c71c39 100644
--- a/.dotter/local.toml
+++ b/.dotter/local.toml
@@ -7,6 +7,7 @@ packages = [
"gtk",
"i3",
"mpd",
+ "neomutt",
"nvim",
"polybar",
"rofi"
diff --git a/.dotter/pre_deploy.sh b/.dotter/pre_deploy.sh
index 6a185be..5309618 100644
--- a/.dotter/pre_deploy.sh
+++ b/.dotter/pre_deploy.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-yay -S alacritty conky dunst i3-wm i3lock mpd polybar rofi gtk-engine-murrine ttf-jetbrains-mono ttf-jetbrains-mono-nerd noto-fonts ttf-font-awesome neovim
+yay -S alacritty conky dunst i3-wm i3lock mpd neomutt polybar rofi gtk-engine-murrine ttf-jetbrains-mono ttf-jetbrains-mono-nerd noto-fonts ttf-font-awesome neovim
diff --git a/neomutt/accounts/venkatesh@tablaster.dev.muttrc b/neomutt/accounts/venkatesh@tablaster.dev.muttrc
new file mode 100644
index 0000000..7b7189f
--- /dev/null
+++ b/neomutt/accounts/venkatesh@tablaster.dev.muttrc
@@ -0,0 +1,21 @@
+# vim: filetype=neomuttrc
+# muttrc file for account venkatesh@tablaster.dev
+set realname = "venkatesh"
+set from = "venkatesh@tablaster.dev"
+set sendmail = "msmtp -a venkatesh@tablaster.dev"
+alias me venkatesh <venkatesh@tablaster.dev>
+set folder = "/home/venkatesh/.local/share/mail/venkatesh@tablaster.dev"
+set header_cache = /home/venkatesh/.cache/neomutt/venkatesh@tablaster.dev/headers
+set message_cachedir = /home/venkatesh/.cache/neomutt/venkatesh@tablaster.dev/bodies
+set mbox_type = Maildir
+set hostname = "tablaster.dev"
+set spoolfile = +INBOX
+set postponed = +Drafts
+set trash = +Trash
+set record = +Sent
+
+macro index o "<shell-escape>mbsync venkatesh@tablaster.dev<enter>" "run mbsync to sync venkatesh@tablaster.dev"
+macro index \eg "<enter-command>unset wait_key<enter><shell-escape>gpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; /usr/libexec/gpg-wks-client --create \$eFGPT \$eID | msmtp --read-envelope-from --read-recipients -a venkatesh@tablaster.dev<enter>" "publish GPG key to WKS provider"
+macro index \eh "<pipe-message>/usr/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a venkatesh@tablaster.dev<enter>" "confirm GPG publication"
+
+mailboxes "=Trash" "=Sent Messages" "=Sent" "=INBOX"
diff --git a/neomutt/colors b/neomutt/colors
new file mode 100644
index 0000000..85ec623
--- /dev/null
+++ b/neomutt/colors
@@ -0,0 +1,69 @@
+# vim: filetype=neomuttrc
+
+color header blue default ".*"
+color header brightmagenta default "^(From)"
+color header brightcyan default "^(Subject)"
+color header brightwhite default "^(CC|BCC)"
+
+mono bold bold
+mono underline underline
+mono indicator reverse
+mono error bold
+color normal default default
+color indicator brightyellow default # currently selected message. default makes bar clear, disabled arrow to save space.
+color sidebar_highlight red default
+color sidebar_divider brightblack black
+color sidebar_flagged red black
+color sidebar_new green black
+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 brightyellow black
+color hdrdefault brightgreen default
+color quoted green default
+color quoted1 blue default
+color quoted2 cyan default
+color quoted3 yellow default
+color quoted4 red default
+color quoted5 brightred default
+color signature brightgreen default
+color bold black default
+color underline black default
+color normal default default
+
+color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
+color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
+color body green default "\`[^\`]*\`" # Green text between ` and `
+color body brightblue default "^# \.*" # Headings as bold blue
+color body brightcyan default "^## \.*" # Subheadings as bold cyan
+color body brightgreen default "^### \.*" # Subsubheadings as bold green
+color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
+color body brightcyan default "[;:][-o][)/(|]" # emoticons
+color body brightcyan default "[;:][)(|]" # emoticons
+color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
+color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
+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.*"
+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<>\"]"
+
+# Default index colors:
+color index yellow default '.*'
+color index_author red default '.*'
+color index_number blue default
+color index_subject cyan default '.*'
+
+# For new mail:
+color index brightyellow black "~N"
+color index_author brightred black "~N"
+color index_subject brightcyan black "~N"
+
+color progress black cyan
diff --git a/neomutt/mailcap b/neomutt/mailcap
new file mode 100644
index 0000000..029c421
--- /dev/null
+++ b/neomutt/mailcap
@@ -0,0 +1,9 @@
+text/plain; $EDITOR %s ;
+text/html; ~/.config/neomutt/openfile %s ; nametemplate=%s.html
+text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump -width=1024 %s; nametemplate=%s.html; copiousoutput;
+image/*; ~/.config/neomutt/openfile %s ;
+video/*; setsid mpv --quiet %s &; copiousoutput
+audio/*; mpv %s ;
+application/pdf; ~/.config/neomutt/openfile %s ;
+application/pgp-encrypted; gpg -d '%s'; copiousoutput;
+application/pgp-keys; gpg --import '%s'; copiousoutput;
diff --git a/neomutt/mappings b/neomutt/mappings
new file mode 100644
index 0000000..ae4c669
--- /dev/null
+++ b/neomutt/mappings
@@ -0,0 +1,80 @@
+# vim: filetype=neomuttrc
+
+bind index,pager i noop
+bind index,pager g noop
+bind index \Cf noop
+bind index,pager M noop
+bind index,pager C noop
+
+# General rebindings
+bind index gg first-entry
+bind index j next-entry
+bind index k previous-entry
+bind attach <return> view-mailcap
+bind attach l view-mailcap
+bind editor <space> noop
+bind index G last-entry
+bind index gg first-entry
+bind pager,attach h exit
+bind pager j next-line
+bind pager k previous-line
+bind pager l view-attachments
+bind index D delete-message
+bind index U undelete-message
+bind index L limit
+bind index h noop
+bind index l display-message
+bind index,query <space> tag-entry
+#bind browser h goto-parent
+macro browser h '<change-dir><kill-line>..<enter>' "Go to parent folder"
+bind index,pager H view-raw-message
+bind browser l select-entry
+bind pager,browser gg top-page
+bind pager,browser G bottom-page
+bind index,pager,browser d half-down
+bind index,pager,browser u half-up
+bind index,pager S sync-mailbox
+bind index,pager R group-reply
+bind index \031 previous-undeleted # Mouse wheel
+bind index \005 next-undeleted # Mouse wheel
+bind pager \031 previous-line # Mouse wheel
+bind pager \005 next-line # Mouse wheel
+bind editor <Tab> complete-query
+
+macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
+macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox"
+macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox"
+macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts"
+macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts"
+macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts"
+macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
+macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
+macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk"
+macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"
+macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
+macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
+macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
+macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
+macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent"
+macro index,pager ga "<change-folder>=Archive<enter>" "go to archive"
+macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive"
+macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive"
+
+#set crypt_autosign = yes
+#set crypt_opportunistic_encrypt = yes
+#set pgp_self_encrypt = yes
+#set pgp_default_key = 'your@gpgemailaddre.ss'
+
+macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook"
+macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
+macro index O "<shell-escape>mbsync -a<enter>" "run mbsync -a to sync all mail"
+macro index \Cf "<enter-command>unset wait_key<enter><shell-escape>printf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms<enter><limit>~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"<enter>" "show only messages matching a notmuch pattern"
+macro index A "<limit>all\n" "show all messages (undo limit)"
+
+# Sidebar mappings
+bind index,pager \Ck sidebar-prev
+bind index,pager \Cj sidebar-next
+bind index,pager \Co sidebar-open
+bind index,pager \Cp sidebar-prev-new
+bind index,pager \Cn sidebar-next-new
+bind index,pager B sidebar-toggle-visible
diff --git a/neomutt/neomuttrc b/neomutt/neomuttrc
new file mode 100644
index 0000000..25a791a
--- /dev/null
+++ b/neomutt/neomuttrc
@@ -0,0 +1,7 @@
+# vim: filetype=neomuttrc
+
+source ~/.config/neomutt/accounts/venkatesh@tablaster.dev.muttrc
+source ~/.config/neomutt/settings
+source ~/.config/neomutt/colors
+source ~/.config/neomutt/mappings
+macro index,pager i1 '<sync-mailbox><enter-command>source /home/venkatesh/.config/neomutt/accounts/venkatesh@tablaster.dev.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to venkatesh@tablaster.dev"
diff --git a/neomutt/openfile b/neomutt/openfile
new file mode 100644
index 0000000..7b229b0
--- /dev/null
+++ b/neomutt/openfile
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/neomutt/files"
+file="$tempdir/${1##*/}"
+[ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid -f xdg-open"
+mkdir -p "$tempdir"
+cp -f "$1" "$file"
+$opener "$file" >/dev/null 2>&1
+find "${tempdir:?}" -mtime +1 -type f -delete
diff --git a/neomutt/settings b/neomutt/settings
new file mode 100644
index 0000000..4b781f8
--- /dev/null
+++ b/neomutt/settings
@@ -0,0 +1,34 @@
+# vim: filetype=neomuttrc
+
+set editor = "nvim"
+set mailcap_path = $HOME/.config/neomutt/mailcap
+set mime_type_query_command = "file --mime-type -b %s"
+set date_format="%y/%m/%d %I:%M%p"
+set index_format="%2C %Z %?X?A& ? %D %-15.15F %s"
+set sort = 'reverse-date'
+set smtp_authenticators = 'gssapi:login'
+set query_command = "abook --mutt-query '%s'"
+set rfc2047_parameters = yes
+set sleep_time = 0 # Pause 0 seconds for informational messages
+set markers = no # Disables the `+` displayed at line wraps
+set mark_old = no # Unread mail stay unread until read
+set mime_forward = yes # attachments are forwarded with mail
+set wait_key = no # mutt won't ask "press key to continue"
+set fast_reply # skip to compose when replying
+set fcc_attach # save attachments with the body
+set forward_format = "Fwd: %s" # format of subject when forwarding
+set forward_quote # include message in forwards
+set reverse_name # reply as whomever it was to
+set include # include message in replies
+set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example)
+auto_view text/html # automatically show html (mailcap uses lynx)
+auto_view application/pgp-encrypted
+#set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages.
+alternative_order text/plain text/enriched text/html
+
+set sidebar_visible = yes
+set sidebar_width = 20
+set sidebar_short_path = yes
+set sidebar_next_new_wrap = yes
+set mail_check_stats
+set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?'