]> git.wh0rd.org Git - home.git/commitdiff
mutt: update settings for newer release
authorMike Frysinger <vapier@gentoo.org>
Thu, 29 Dec 2016 23:17:15 +0000 (18:17 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 29 Dec 2016 23:17:15 +0000 (18:17 -0500)
.config/mutt/list-mailboxes.py [new file with mode: 0755]
.config/mutt/lists.rc
.config/mutt/mail.rc
.config/mutt/main.rc
.config/mutt/sidebar.rc
.config/mutt/theme/xterm-256color.rc [new file with mode: 0644]

diff --git a/.config/mutt/list-mailboxes.py b/.config/mutt/list-mailboxes.py
new file mode 100755 (executable)
index 0000000..f6e0a01
--- /dev/null
@@ -0,0 +1,70 @@
+#!/usr/bin/python
+
+"""Produce a "sorted" list of maildir paths based on subdirs."""
+
+from __future__ import print_function
+
+import os
+import sys
+
+
+IGNORED_DIRS = set((
+    'drafts',
+    'outbox',
+    'templates',
+    '.inbox.directory',
+))
+
+
+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'):
+            continue
+
+        fulld = os.path.join(topdir, d)
+        if d.startswith('.') or fulld 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
+
+
+def main(argv):
+    maildir = os.path.expanduser('~/.mail/')
+    results = []
+    ignored = set(os.path.join(maildir, x) for x in IGNORED_DIRS)
+
+    results = find_dirs(maildir, ignored)
+    print(' '.join('"%s"' % 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 353c093d9b71d15f72b970a3e30969dee0b2d796..9ebe7b76bb7a3365117cc9188ba1eb7a081165fe 100644 (file)
@@ -13,7 +13,12 @@ subscribe -group oss       \
        "^LINUX-390@VM\.MARIST\.EDU$" \
        "^procps@freelists.org$" \
        "@lists\.denx\.de$" \
-       "@lists\.linux\.it$"
-subscribe -group gnu       "(^bug-.*|-(dev(el)?|patches))@(non)?gnu\.org$" "@debbugs\.gnu\.org$" "^(auto(conf|make)|coreutils|libtool)@gnu\.org$"
+       "@lists\.linux\.it$" \
+       "@lists\.php\.net$" \
+       "^security@libgd\.org$"
+subscribe -group gnu       \
+       "(^(bug|help|info)-.*|-(dev(el)?|patches))@(non)?gnu\.org$" \
+       "@debbugs\.gnu\.org$" \
+       "^(auto(conf|make)|coreutils|libtool)@gnu\.org$"
 subscribe -group spec      "-l@opengroup\.org$"
 subscribe -group unicode   "-users@unicode\.org"
index 52e18ac3eef75d4a2fbf35ba41e84dc92f1157b2..1a7e2f2d6074aee8d784541360386f035cca1820 100644 (file)
@@ -8,8 +8,5 @@ set postponed = +/drafts
 set header_cache = ~/.cache/mutt/header
 set message_cachedir = ~/.cache/mutt/message
 
-mailboxes `find ~/.mail/ \
-       -regextype posix-extended -type d \
-       '(' -regex '.*/(cur|new|tmp)$' -o -regex '.*/\.mail/(drafts|outbox|templates|\.inbox\.directory)$' -prune ')' \
-       -name cur -printf '"%h" ' 2>/dev/null | sort`
+mailboxes `~/.config/mutt/list-mailboxes.py`
 unmailboxes ~/.mail
index ec30eec8ea27d183b2ffc6c457765119b64e588c..b8c30924d3c3bbc14fb9eb829605e58952f76fe1 100644 (file)
@@ -30,6 +30,7 @@ set pager_stop = yes
 set autoedit = yes
 set editor = "nano -r 80"
 set fast_reply = yes
+#set reply_regexp = "^(([Rr][Ee]|[aA][wW]):[[:space:]]*)*"
 set include = yes
 
 ignore *
index a3a03a0a35e18fd974e2e74de34c5c90a5db3c55..07b38b5c03f4e952c45820287a3a2422010864cd 100644 (file)
@@ -1,12 +1,15 @@
-set sidebar_delim = '│'
-set sidebar_folderindent = yes
+set sidebar_divider_char = '│ '
+set sidebar_folder_indent = yes
 set sidebar_format = '%B %* %N' # %F %S'
-set sidebar_indentstr = ' '
-set sidebar_shortpath = yes
-set sidebar_sort = yes
+set sidebar_indent_string = ' '
+set sidebar_short_path = yes
 set sidebar_visible = yes
 set sidebar_width = 30
 
+# Needed so stats show up in the sidebar.
+set mail_check_stats = yes
+set mail_check_stats_interval = 600
+
 color sidebar_new brightred default
 
 bind index \Ck sidebar-prev
diff --git a/.config/mutt/theme/xterm-256color.rc b/.config/mutt/theme/xterm-256color.rc
new file mode 100644 (file)
index 0000000..596d5c2
--- /dev/null
@@ -0,0 +1 @@
+source ~/.config/mutt/theme/256color.rc