Browse Source

Added notmuch searching to mutt

tags/v0.2.0
Micah Halter 10 months ago
parent
commit
1ad0acce2b
5 changed files with 122 additions and 1 deletions
  1. 3
    0
      Makefile
  2. 2
    0
      README.md
  3. 15
    0
      mutt/.config/mutt/muttrc
  4. 100
    0
      notmuch/.notmuch-config
  5. 2
    1
      offlineimap/.offlineimaprc

+ 3
- 0
Makefile View File

@@ -83,6 +83,8 @@ arch: pacman
83 83
 		neovim \
84 84
 		network-manager-applet \
85 85
 		networkmanager \
86
+		notmuch \
87
+		notmuch-mutt \
86 88
 		ntp \
87 89
 		openssh \
88 90
 		pandoc \
@@ -281,6 +283,7 @@ stow-base: update stow-pre
281 283
 		ncpamixer \
282 284
 		neofetch \
283 285
 		neovim \
286
+		notmuch \
284 287
 		newsboat \
285 288
 		offlineimap \
286 289
 		pass \

+ 2
- 0
README.md View File

@@ -49,6 +49,7 @@ Linux rice.
49 49
 - [neomutt](https://github.com/neomutt/neomutt)
50 50
 - [neovim](https://github.com/neovim/neovim)
51 51
 - [newsboat](https://github.com/newsboat/newsboat)
52
+- [notmuch](https://notmuchmail.org/)
52 53
 - [qutebrowser](https://github.com/qutebrowser/qutebrowser)
53 54
 - [ranger](https://github.com/ranger/ranger)
54 55
 - [rtv](https://github.com/michael-lazar/rtv)
@@ -78,6 +79,7 @@ Linux rice.
78 79
     - [mpv](https://github.com/mpv-player/mpv)
79 80
     - msmtp
80 81
     - [ncpamixer](https://github.com/fulhax/ncpamixer)
82
+    - [notmuch-mutt](https://notmuchmail.org/notmuch-mutt/)
81 83
     - [offlineimap](https://github.com/OfflineIMAP/offlineimap)
82 84
     - [oomox](https://github.com/actionless/oomox)
83 85
     - [pass](https://www.passwordstore.org/)

+ 15
- 0
mutt/.config/mutt/muttrc View File

@@ -60,3 +60,18 @@ macro index Z "<shell-escape>offlineimap<enter>" "sync all mail"
60 60
 
61 61
 macro index,pager \cu "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
62 62
 macro attach,compose \cu "<pipe-entry> urlscan<Enter>" "call urlscan to extract URLs out of a message"
63
+
64
+# notmuch search
65
+macro index <F8> \
66
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
67
+<shell-escape>notmuch-mutt -r --prompt search<enter>\
68
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
69
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
70
+"notmuch: search mail"
71
+
72
+macro index <F9> \
73
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
74
+<pipe-message>notmuch-mutt -r thread<enter>\
75
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
76
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
77
+"notmuch: reconstruct thread"

+ 100
- 0
notmuch/.notmuch-config View File

@@ -0,0 +1,100 @@
1
+# .notmuch-config - Configuration file for the notmuch mail system
2
+#
3
+# For more information about notmuch, see https://notmuchmail.org
4
+
5
+# Database configuration
6
+#
7
+# The only value supported here is 'path' which should be the top-level
8
+# directory where your mail currently exists and to where mail will be
9
+# delivered in the future. Files should be individual email messages.
10
+# Notmuch will store its database within a sub-directory of the path
11
+# configured here named ".notmuch".
12
+#
13
+[database]
14
+path=/home/micah/.Mail
15
+
16
+# User configuration
17
+#
18
+# Here is where you can let notmuch know how you would like to be
19
+# addressed. Valid settings are
20
+#
21
+#	name		Your full name.
22
+#	primary_email	Your primary email address.
23
+#	other_email	A list (separated by ';') of other email addresses
24
+#			at which you receive email.
25
+#
26
+# Notmuch will use the various email addresses configured here when
27
+# formatting replies. It will avoid including your own addresses in the
28
+# recipient list of replies, and will set the From address based on the
29
+# address to which the original email was addressed.
30
+#
31
+[user]
32
+name=Micah Halter
33
+primary_email=micah@mehalter.com
34
+other_email=mehalter@gatech.edu;
35
+
36
+# Configuration for "notmuch new"
37
+#
38
+# The following options are supported here:
39
+#
40
+#	tags	A list (separated by ';') of the tags that will be
41
+#		added to all messages incorporated by "notmuch new".
42
+#
43
+#	ignore	A list (separated by ';') of file and directory names
44
+#		that will not be searched for messages by "notmuch new".
45
+#
46
+#		NOTE: *Every* file/directory that goes by one of those
47
+#		names will be ignored, independent of its depth/location
48
+#		in the mail store.
49
+#
50
+[new]
51
+tags=unread;inbox;
52
+ignore=
53
+
54
+# Search configuration
55
+#
56
+# The following option is supported here:
57
+#
58
+#	exclude_tags
59
+#		A ;-separated list of tags that will be excluded from
60
+#		search results by default.  Using an excluded tag in a
61
+#		query will override that exclusion.
62
+#
63
+[search]
64
+exclude_tags=deleted;spam;
65
+
66
+# Maildir compatibility configuration
67
+#
68
+# The following option is supported here:
69
+#
70
+#	synchronize_flags      Valid values are true and false.
71
+#
72
+#	If true, then the following maildir flags (in message filenames)
73
+#	will be synchronized with the corresponding notmuch tags:
74
+#
75
+#		Flag	Tag
76
+#		----	-------
77
+#		D	draft
78
+#		F	flagged
79
+#		P	passed
80
+#		R	replied
81
+#		S	unread (added when 'S' flag is not present)
82
+#
83
+#	The "notmuch new" command will notice flag changes in filenames
84
+#	and update tags, while the "notmuch tag" and "notmuch restore"
85
+#	commands will notice tag changes and update flags in filenames
86
+#
87
+[maildir]
88
+synchronize_flags=true
89
+
90
+# Cryptography related configuration
91
+#
92
+# The following *deprecated* option is currently supported:
93
+#
94
+#	gpg_path
95
+#		binary name or full path to invoke gpg.
96
+#		NOTE: In a future build, this option will be ignored.
97
+#		Setting $PATH is a better approach.
98
+#
99
+[crypto]
100
+gpg_path=gpg

+ 2
- 1
offlineimap/.offlineimaprc View File

@@ -9,6 +9,7 @@ pythonfile = ~/.offlineimap.py
9 9
 [Account gmail]
10 10
 localrepository = gmail-local
11 11
 remoterepository = gmail-remote
12
+postsynchook = notmuch new
12 13
 
13 14
 [Repository gmail-remote]
14 15
 type = Gmail
@@ -23,9 +24,9 @@ localfolders = ~/.Mail/Gmail
23 24
 
24 25
 
25 26
 [Account gatech]
26
-
27 27
 localrepository = gatech-local
28 28
 remoterepository = gatech-remote
29
+postsynchook = notmuch new
29 30
 
30 31
 [Repository gatech-remote]
31 32
 type = IMAP

Loading…
Cancel
Save