summaryrefslogtreecommitdiffhomepage
path: root/custom/jao-custom-notmuch.el
diff options
context:
space:
mode:
Diffstat (limited to 'custom/jao-custom-notmuch.el')
-rw-r--r--custom/jao-custom-notmuch.el31
1 files changed, 14 insertions, 17 deletions
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el
index 974a577..f7996ac 100644
--- a/custom/jao-custom-notmuch.el
+++ b/custom/jao-custom-notmuch.el
@@ -11,26 +11,23 @@
,(concat "tag:new and not "
"tag:\"/feeds|local|hacking|draft|inbox|prog|words|write/\"")
:face default)
- (:name "H" :query "tag:new and tag:hacking and not tag:\"/emacs/\"")
- (:name "E" :query "tag:new and tag:\"/emacs/\"")
+ (:name "h" :query "tag:new and tag:hacking and not tag:\"/emacs/\"")
+ (:name "e" :query "tag:new and tag:\"/emacs/\"")
(: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)))
+ (:name "f" :query "tag:new and tag:feeds and not tag:\"/emacs/\"")))
(defsubst jao-notmuch--qstr (c)
(format "%s%s" (plist-get c :name) (plist-get c :count)))
-(defvar jao-notmuch-mac-xbar t)
-(defvar jao-notmuch-mac-mail-badge nil)
+(defvar jao-notmuch-mac-mail-badge nil
+ "Name of Mac mail app showing, besides emacs")
+(defvar jao-notmuch-mac-hammerspoon (jao-is-darwin))
-(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-hammerspoon ()
+ (jao-when-darwin
+ (let* ((s (substring-no-properties jao-notmuch-minibuffer-string))
+ (s (string-replace " " "%20" s)))
+ (jao-mac-open "-g hammerspoon://menu?message=%s" s))))
(defun jao-notmuch-notify ()
(interactive)
@@ -43,11 +40,11 @@
(setq jao-notmuch-minibuffer-string
(mapconcat (lambda (c)
(propertize (jao-notmuch--qstr c)
- 'face (or (plist-get c :face)
- 'jao-themes-dimm)))
+ 'face
+ (or (plist-get c :face) 'jao-themes-dimm)))
cnts
" "))
- (jao-when-darwin (when jao-notmuch-mac-xbar (jao-notmuch-xbar)))
+ (when jao-notmuch-mac-hammerspoon (jao-notmuch-hammerspoon))
(jao-minibuffer-refresh)))
(defun jao-notmuch-notify-and-update (&optional first agenda)