summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--custom/jao-custom-gnus.el42
-rw-r--r--init.el5
-rw-r--r--lib/doc/jao-mac.el9
-rw-r--r--lib/net/jao-notmuch-gnus.el2
4 files changed, 41 insertions, 17 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 4535fd3..2cd2499 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -201,7 +201,7 @@
(mapcar (lambda (b)
`(imap :server "127.0.0.1" :port 1143
:user "jaor@pm.me" :password ,pwd
- :stream starttls :predicate "DELETED UNSEEN"
+ :stream starttls :predicate ""
:fetchflag ""
:mailbox ,(if b (concat "Folders/" b) "INBOX")))
(or folders '(nil "drivel" "hacking" "bills" "prog" "words"))))
@@ -658,18 +658,21 @@
(let ((feeds (thread-first
(directory-files mail-source-directory nil "feeds\\.[^e]")
(seq-difference '("feeds.trove")))))
- `(("nnml:bigml\\.inbox" "B" jao-themes-f00)
- ("nnml:bigml\\.alba" "A" jao-themes-f00)
- ("nnml:bigml\\.ryou" "R" jao-themes-f00)
- ("nnml:bigml\\.bugs" "b" jao-themes-error)
- ("nnml:bigml\\.support" "S" default)
- ("nnml:bigml\\.[^aibsr]" "W" jao-themes-dimm)
+ `(
+ ;; ("nnml:bigml\\.inbox" "B" jao-themes-f00)
+ ;; ("nnml:bigml\\.alba" "A" jao-themes-f00)
+ ;; ("nnml:bigml\\.ryou" "R" jao-themes-f00)
+ ;; ("nnml:bigml\\.bugs" "b" jao-themes-error)
+ ;; ("nnml:bigml\\.support" "S" default)
+ ;; ("nnml:bigml\\.[^aibsr]" "W" jao-themes-dimm)
+ ("nnml:jao\\.bigml" "B" jao-themes-f00)
("nnml:jao\\.\\(inbox\\|trove\\)" "I" jao-themes-f01)
- ("nnml:jao.hacking" "H" jao-themes-dimm)
+ ("nnml:jao.hunting" "H" jao-themes-f02)
("nnml:jao.write" "W" jao-themes-warning)
("nnml:jao.[^ithw]" "J" jao-themes-dimm)
+ ("nnml:jao.hacking" "J" jao-themes-dimm)
(,(format "^nnml:%s" (regexp-opt feeds)) "F" jao-themes-dimm)
- ("feeds\\.e" "E" jao-themes-dimm)
+ ;; ("feeds\\.e" "E" jao-themes-dimm)
("nnml:local" "l" jao-themes-dimm)
("nnrss:.*" "R" jao-themes-dimm)
("^\\(gwene\\|gmane\\)\\." "N" jao-themes-dimm))))
@@ -690,12 +693,19 @@
(defvar jao-gnus--notify-strs ())
+(defun jao-gnus--nnw-count ()
+ (jao-when-darwin
+ (when-let* ((n (jao-nnw-unread-count)))
+ (when (> n 0) (list (format "(%s)" n))))))
+
(defun jao-gnus--notify-strs ()
(let ((counts (jao-gnus--unread-counts)))
- (seq-filter #'identity
- (seq-map (lambda (args)
- (apply 'jao-gnus--unread-label counts args))
- jao-gnus-tracked-groups))))
+ (append
+ (seq-filter #'identity
+ (seq-map (lambda (args)
+ (apply 'jao-gnus--unread-label counts args))
+ jao-gnus-tracked-groups))
+ (jao-gnus--nnw-count))))
(defun jao-gnus--notify ()
(setq jao-gnus--notify-strs (jao-gnus--notify-strs))
@@ -794,7 +804,11 @@
'("message/rfc822" . jao-gnus-goto-file))))
;;;; notmuch
(use-package jao-notmuch-gnus
- :demand t)
+ :demand t
+ :init
+ (jao-when-darwin
+ (setq jao-notmuch-gnus-mail-directory
+ (expand-file-name "gnus" jao-maildir))))
(jao-load-path "consult-notmuch")
diff --git a/init.el b/init.el
index ff43e11..edddf6a 100644
--- a/init.el
+++ b/init.el
@@ -223,7 +223,7 @@
(defun jao-kb-toggle (&optional lyt)
(interactive)
(shell-command-to-string (or lyt
- (if (jao-kb-toggled-p)
+ (if (jao-kb-toggled-p)
"setxkbmap us"
"setxkbmap us -variant intl"))))
@@ -589,7 +589,8 @@
(with-eval-after-load "jao-minibuffer"
(if jao-mode-line-in-minibuffer
(display-battery-mode 1)
- (jao-minibuffer-add-variable 'battery-mode-line-string 80)))
+ (jao-when-linux
+ (jao-minibuffer-add-variable 'battery-mode-line-string 80))))
:config
(jao-when-darwin (display-battery-mode 1)))
diff --git a/lib/doc/jao-mac.el b/lib/doc/jao-mac.el
index 06d6ad3..822cdb0 100644
--- a/lib/doc/jao-mac.el
+++ b/lib/doc/jao-mac.el
@@ -130,6 +130,15 @@
(browse-url url))
(message "No article selected in NetNewsWire")))
+(defvar jao-nnw--label-cmd
+ "lsappinfo info -app NetNewsWire -only StatusLabel")
+
+(defun jao-nnw-unread-count ()
+ "A very hacky, yet efficient, way of getting NNW's badge."
+ (let ((s (shell-command-to-string jao-nnw--label-cmd)))
+ (when (string-match ".*=\"\\([0-9]+\\)\" ." s)
+ (string-to-number (match-string 1 s)))))
+
;;; Safari
(defun jao-safari-current-url ()
(jao-mac-tell-app "Safari" "return URL of current tab of window 1"))
diff --git a/lib/net/jao-notmuch-gnus.el b/lib/net/jao-notmuch-gnus.el
index 5cd42fa..3abfaee 100644
--- a/lib/net/jao-notmuch-gnus.el
+++ b/lib/net/jao-notmuch-gnus.el
@@ -176,7 +176,7 @@ Example:
(msg-id (when msg-id (replace-regexp-in-string "^id:" "" msg-id))))
(if (and group msg-id)
(org-gnus-follow-link group msg-id)
- (message "Couldn't get relevant infos for switching to Gnus."))))
+ (message "Couldn't get relevant info for switching to Gnus."))))
(defun jao-notmuch-gnus-engine (prefix config)
(let ((prefix (file-name-as-directory (expand-file-name prefix "~")))