From fc3499cefb869eaa1ea17a033b547d93f1b4abca Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Sat, 4 Feb 2023 13:05:26 -0500 Subject: [PATCH] Tweak mu4e and enable notifs --- config.org | 23 ++++++++++++++++++++++- packages.el | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index 794f479..34c3d01 100644 --- a/config.org +++ b/config.org @@ -988,7 +988,6 @@ Setup the maildirs we want to see, we'll show our notifications '((:maildir "/nathan@mccarty.io/Folders/Notifications/Github" :key ?h) (:maildir "/nathan@mccarty.io/Folders/Notifications/Gitlab" :key ?l) (:maildir "/nathan@mccarty.io/Folders/Notifications/SourceHut" :key ?s) - (:maildir "/nathan@mccarty.io/Folders/Mailing Lists/Lobsters" :key ?a) (:maildir "/nathan@mccarty.io/Folders/Archival/Receipts/2023" :key ?r) (:maildir "/nathan@mccarty.io/Folders/Archival/Job Search" :key ?j) (:maildir "/nathan@mccarty.io/Folders/Archival/Informed Delivery" :key ?i)))) @@ -1005,6 +1004,28 @@ We need to tell mu4e to rename files when they are moved, or else mbsync will br (after! mu4e (setq mu4e-change-filenames-when-moving t)) #+end_src + +Now setup notifications +#+begin_src emacs-lisp +(use-package! mu4e-alert + :config + (mu4e-alert-set-default-style 'libnotify) + (setq mu4e-alert-interesting-mail-query + (concat + "flag:unread" + " AND NOT flag:trashed" + " AND NOT maildir:" + "\"/nathan@mccarty.io/Spam\"" + "\"/nathan@mccarty.io/Folders/Mailing Lists\"" + "\"/nathan@mccarty.io/Trash\""))) +#+end_src + +Add to the modeline and enable nofitications, but only when we are the daemon +#+begin_src emacs-lisp +(when (daemonp) + (add-hook 'after-init-hook #'mu4e-alert-enable-notifications) + (add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display)) +#+end_src ** [[https://github.com/stsquad/emacs_chrome][Edit with Emacs]] #+begin_src emacs-lisp (use-package! edit-server diff --git a/packages.el b/packages.el index 6ffeadf..a753174 100644 --- a/packages.el +++ b/packages.el @@ -76,3 +76,4 @@ (package! org-chef) (package! keychain-environment) (package! hotfuzz) +(package! mu4e-alert)