diff options
Diffstat (limited to 'custom')
| -rw-r--r-- | custom/jao-custom-notmuch.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 2731fe2..4a21816 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -18,17 +18,30 @@ (:name "l" :query "tag:new and tag:local") (:name "F" :query "tag:new and tag:feeds and not tag:\"/emacs/\""))) +(defvar jao-notmuch-xbar-queries + `((:name "" :query "tag:new and not tag:draft" :face jao-themes-f00) + (:name "i" :query "tag:new and tag:/inbox|write|drivel/" + :face jao-themes-warning))) + +(defsubst jao-notmuch--qstr (c) + (format "%s%s" (plist-get c :name) (plist-get c :count))) + +(defun jao-notmuch-xbar () + (let ((cnts (notmuch-hello-query-counts jao-notmuch-xbar-queries))) + (jao-shell-exec (format "echo '%s | color=#8b3626 | size=11' >/tmp/xbar" + (mapconcat 'jao-notmuch--qstr cnts " "))))) + (defun jao-notmuch-notify () + (interactive) (let ((cnts (notmuch-hello-query-counts jao-notmuch-minibuffer-queries))) (setq jao-notmuch-minibuffer-string (mapconcat (lambda (c) - (propertize (format "%s%s" - (plist-get c :name) - (plist-get c :count)) + (propertize (jao-notmuch--qstr c) 'face (or (plist-get c :face) 'jao-themes-dimm))) cnts " ")) + (jao-when-darwin (jao-notmuch-xbar)) (jao-minibuffer-refresh))) (when jao-notmuch-enabled |
