summaryrefslogtreecommitdiffhomepage
path: root/custom/jao-custom-gnus.el
diff options
context:
space:
mode:
Diffstat (limited to 'custom/jao-custom-gnus.el')
-rw-r--r--custom/jao-custom-gnus.el65
1 files changed, 39 insertions, 26 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index bc39f5b..597ad70 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -89,7 +89,12 @@
(defun jao-gnus-use-two-panes ()
(let ((wide-len jao-gnus-wide-width)
(groups-len jao-gnus-groups-width)
- (summary-len (- jao-gnus-wide-width jao-gnus-groups-width)))
+ (summary-len (- jao-gnus-wide-width jao-gnus-groups-width))
+ (msg-edit '(horizontal 1.0
+ (message 1.0 point)
+ (vertical 0.5
+ ("*Org Agenda*" 0.5)
+ ("inbox.org" 1.0)))))
(gnus-add-configuration
`(article
(horizontal 1.0
@@ -102,16 +107,8 @@
`(group (horizontal 1.0
(group 0.5 point)
(vertical 1.0
- ("*Org Agenda*" 0.5)
- ("inbox.org" 1.0)
- ;; ("*notmuch-hello*" 1.0)
- ))))
-
- (gnus-add-configuration
- `(message (horizontal 1.0 (message 1.0 point))))
-
- (gnus-add-configuration
- `(reply-yank (horizontal 1.0 (message 1.0 point))))
+ ("*Org Agenda*" 1.0)
+ ("*Calendar*" 9)))))
(gnus-add-configuration
`(summary
@@ -119,11 +116,16 @@
(vertical ,groups-len (group 1.0))
(vertical 1.0 (summary 1.0 point)))))
+ (gnus-add-configuration `(message ,msg-edit))
+
+ (gnus-add-configuration `(forward ,msg-edit))
+
+ (gnus-add-configuration `(reply-yank ,msg-edit))
+
(gnus-add-configuration
- `(reply
- (horizontal 1.0
- (message ,(- wide-len 100) point)
- (article 1.0))))))
+ `(reply (horizontal 1.0
+ (message ,(- wide-len 100) point)
+ (article 1.0))))))
(if jao-gnus-use-three-panes
(jao-gnus-use-three-panes)
@@ -255,10 +257,12 @@
;;; groups
(setq gnus-group-line-format
- " %m%S%p%3y%P%* %~(pad-right 30)G %B\n"
+ " %m%S%p%3y%P%* %~(pad-right 25)G %B\n"
;; " %m%S%p%P:%~(pad-right 35)c %3y %B\n"
;; " %m%S%p%3y%P%* %~(pad-right 30)C %B\n"
- gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n"
+ ;; gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n"
+ gnus-face-2 'jao-themes-f11
+ gnus-topic-line-format "%i %2{%~(pad-right 8)n ┄┄ %A%v%}\n"
gnus-group-uncollapsed-levels 2
gnus-auto-select-subject 'unread
gnus-large-newsgroup 2000)
@@ -642,6 +646,8 @@
(let ((inhibit-message t))
(gnus-demon-scan-news)
(jao-shell-exec "notmuch-gnus-tags.sh")
+ (when-let* ((a (get-buffer "*Org Agenda*")))
+ (with-current-buffer a (org-agenda-redo-all)))
(jao-gnus--notify)))
(defun jao-gnus--scan-local-mail ()
@@ -696,9 +702,12 @@
(defun jao-gnus--unread-counts ()
(seq-reduce (lambda (r g)
(let ((n (gnus-group-unread (car g))))
- (if (and (numberp n) (> n 0)) (cons (cons (car g) n) r) r)))
+ (if (and (numberp n) (> n 0))
+ (cons (+ n (car r))
+ (cons (cons (car g) n) (cdr r)))
+ r)))
gnus-newsrc-alist
- ()))
+ '(0)))
(defun jao-gnus-unread-count ()
(seq-reduce (lambda (c g) (+ c (or (gnus-group-unread (car g)) 0)))
@@ -725,13 +734,17 @@
(or (car (jao-gnus--nnw-count)) ""))))
(defun jao-gnus--notify-strs ()
- (let ((counts (jao-gnus--unread-counts)))
- (append
- (seq-filter #'identity
- (seq-map (lambda (args)
- (apply 'jao-gnus--unread-label counts args))
- jao-gnus-tracked-groups))
- (jao-gnus--nnw-count))))
+ (let* ((all (jao-gnus--unread-counts))
+ (counts (cdr all))
+ (total (car all)))
+ (jao-when-darwin
+ (jao-shell-exec
+ (format "echo '%s | color=%s' >/tmp/xbar"
+ total (if (> total 0) "#8b3626" "#efefef"))))
+ (seq-filter #'identity
+ (seq-map (lambda (args)
+ (apply 'jao-gnus--unread-label counts args))
+ jao-gnus-tracked-groups))))
(defun jao-gnus--notify ()
(setq jao-gnus--notify-strs (jao-gnus--notify-strs))