]> git.wh0rd.org - home.git/commitdiff
mutt: update configs
authorMike Frysinger <vapier@gentoo.org>
Mon, 15 Feb 2021 04:07:14 +0000 (23:07 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 15 Feb 2021 04:07:14 +0000 (23:07 -0500)
.config/mutt/bindings.rc
.config/mutt/formatting.rc
.config/mutt/gpg.rc
.config/mutt/list-mailboxes.py
.config/mutt/main.rc
.config/mutt/sidebar.rc

index 2f748205da37ed19c8d730fa58009c0cb7f81877..593248c6e6690216c259dceba019c35ba2fcc398 100644 (file)
@@ -1,8 +1,13 @@
 # http://www.mutt.org/doc/manual/manual-6.html#functions
 
+#bind generic \Cc exit
+#quit
+set quit=ask-no
+
 bind index , current-middle
 bind index t noop
 bind index T noop
+bind index V collapse-all
 bind index x tag-entry
 bind index X tag-pattern
 bind index <left> previous-line
index b8fcf0409b65a7951f75ce44d2fc8ea007fc2609..67e957b8c580a190bdbc52b3d8862abb2ffebc91 100644 (file)
@@ -43,7 +43,7 @@ set folder_format="%F  %d %8s   %f" # file browser menu
 set folder_format="sh -c '~/.config/mutt/folder.sh \"$@\"' -- '%f' '%F  %d %8s'|"
 
 # http://www.mutt.org/doc/devel/manual.html#index-format
-set index_format = "%4C %Z %?M?»& ?%s %*  %B  %-20.20n  %D"
+set index_format = "%Z%?M?»& ?%s %*  %B %-20.20n %D"
 
 #set pager_format="-%Z- %C/%m [%[%H:%M]] %-17.17n   %s"
 
@@ -58,8 +58,13 @@ set index_format = "%4C %Z %?M?»& ?%s %*  %B  %-20.20n  %D"
 # %?<sequence_char>?<optional_string>?   print <opt> iff <seq> is non zero
 # %?<sequence_char>?<if_string>&<else_string>?
 #
-#set status_format="[%r] %h %f (%s) [%M/%m] [N=%n,*=%t,post=%p,new=%b]"
+set status_format="[%r] %h %f (%s) [%M/%m] [N=%n,*=%t,post=%p,new=%b]"
 #set status_format="-%r-%v--[%?M?%M/?%m msgs%?n?, %n new?%?d?, %d del?%?F?, %F flag?%?t?, %t tag?%?p?, %p postp?%?b?, %b inc?%?l?, %l?]--(%f)--%s/%S-%>-%P-"
 #set status_format="-%r-%v--[%?M?%M/?%m msgs%?n?, %n new?%?d?, %d del?%?F?, %F flag?%?t?, %t tag?%?p?, %p postp?%?b?, %b inc?%?l?, ?%?L?%L/?%?l?%l?]--(%f)--%s/%S-%>-%P-"
 #set status_format="-%r-%v--[%?M?%M/?%m msgs%?n?, %n new?%?d?, %d del?%?F?, %F flag?%?t?, %t tag?%?p?, %p postp?%?b?, %b inc?%?l?, %l?]--(%f)--%s-%>-%P-"
 #set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───"
+
+# https://dev.mutt.org/doc/manual.html#ts-enabled
+# Set the terminal status line (title).
+set ts_enabled = yes
+set ts_status_format = "%v %h %f"
index 0b0ef16a7f1ed95224b1be96c76bdfc2530ef4d8..b986d13abc022358007e82dcaa94ed8337e46f73 100644 (file)
@@ -11,13 +11,14 @@ set pgp_use_gpg_agent = yes
 # breaking PGP/MIME.
 
 # decode application/pgp
-set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
+set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f 2>/dev/null"
+# 2>&1 | grep -E -v '^gpg:.+(aka|Signature made)'"
 
 # verify a pgp/mime signature
-set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f 2>&1 | grep -E -v '^gpg:.+(aka|Signature made)'"
+set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f 2>/dev/null"
 
 # decrypt a pgp/mime attachment
-set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
+set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f 2>/dev/null"
 
 # create a pgp/mime signed attachment
 set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
index f6e0a014cef594d95a507bb3b0776cdca63467ff..3737d7ad2c452cbd96002013e271dbabe9bbaf67 100755 (executable)
@@ -1,70 +1,49 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 """Produce a "sorted" list of maildir paths based on subdirs."""
 
 from __future__ import print_function
 
 import os
+from pathlib import Path
 import sys
 
 
-IGNORED_DIRS = set((
+IGNORED_DIRS = {
     'drafts',
     'outbox',
     'templates',
     '.inbox.directory',
-))
+}
+MAILDIR_DIRS = {
+    'cur', 'new', 'tmp',
+}
 
 
 def find_dirs(topdir, ignored):
     """Walk the subdirs following the KDE layout."""
-    ret = []
-    for d in sorted(os.listdir(topdir)):
-        if d in ('cur', 'new', 'tmp'):
+    for d in sorted(topdir.iterdir()):
+        if d.name in MAILDIR_DIRS:
             continue
 
-        fulld = os.path.join(topdir, d)
-        if d.startswith('.') or fulld in ignored:
+        if d in ignored:
             continue
-        if not os.path.islink(fulld):
-            if os.path.isdir(os.path.join(fulld, 'cur')):
-                ret.append(fulld)
-                subdir = os.path.join(topdir, '.%s.directory' % d)
-                if subdir not in ignored and os.path.isdir(subdir):
-                    ret.extend(find_dirs(subdir, ignored))
-
-    return ret
+        if not d.is_symlink():
+            if (d / 'cur').is_dir():
+                yield d
+                subdir = topdir / f'.{d.name}.directory'
+                if subdir not in ignored and subdir.is_dir():
+                    yield from find_dirs(subdir, ignored)
 
 
 def main(argv):
-    maildir = os.path.expanduser('~/.mail/')
-    results = []
-    ignored = set(os.path.join(maildir, x) for x in IGNORED_DIRS)
+    maildir = Path('~/.mail/').expanduser()
+    ignored = {maildir / x for x in IGNORED_DIRS}
 
     results = find_dirs(maildir, ignored)
-    print(' '.join('"%s"' % x for x in results))
+    print(' '.join(f'"{x}"' for x in results))
     return 0
 
 
-# Old logic that doesn't sort right.
-    for root, dirs, _ in os.walk(maildir, followlinks=False):
-        for d in ('cur', 'new', 'tmp'):
-            try:
-                dirs.remove(d)
-            except ValueError:
-                pass
-
-        dirs.sort()
-        for d in dirs[:]:
-            fulld = os.path.join(root, d)
-            if fulld in ignored:
-                dirs.remove(d)
-            elif not os.path.islink(fulld):
-                if os.path.isdir(os.path.join(fulld, 'cur')):
-                    results.append(fulld)
-
-    print('\n'.join('"%s"' % x for x in results))
-
-
 if __name__ == '__main__':
     sys.exit(main(sys.argv[1:]))
index b8c30924d3c3bbc14fb9eb829605e58952f76fe1..d21b3001485f43a2e7cf5ba00a2515df0b3af155 100644 (file)
@@ -22,6 +22,8 @@ set sort = threads
 set strict_threads = yes
 set sort_browser = alpha
 set sort_aux = last-date-received
+set help = no
+set hide_missing = no
 set hide_thread_subject = yes
 #set menu_scroll = yes
 set pager_context = 10
index 07b38b5c03f4e952c45820287a3a2422010864cd..5a8db6e0e2abceef92b41604f280a09ca6f5871a 100644 (file)
@@ -2,6 +2,7 @@ set sidebar_divider_char = '│ '
 set sidebar_folder_indent = yes
 set sidebar_format = '%B %* %N' # %F %S'
 set sidebar_indent_string = ' '
+set sidebar_relative_shortpath_indent = no
 set sidebar_short_path = yes
 set sidebar_visible = yes
 set sidebar_width = 30