summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2025-11-04 23:59:37 +0000
committerjao <jao@gnu.org>2025-11-04 23:59:37 +0000
commit75ec1638a16c3ccfbb1cfbe189e48e111eb80bdd (patch)
tree40f642f0631e33138d008b6ca71f0b3a93fe4134 /custom
parentb9ac9409940f259cc1329f2b99b5b4fa04279e66 (diff)
downloadelibs-75ec1638a16c3ccfbb1cfbe189e48e111eb80bdd.tar.gz
elibs-75ec1638a16c3ccfbb1cfbe189e48e111eb80bdd.tar.bz2
notmuch: xbar
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-notmuch.el19
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