fix[client]: make emacs mail notifications work
Some checks are pending
Flake check / Check flake (push) Waiting to run

This commit is contained in:
Leon Schwarzäugl 2025-10-21 22:19:08 +02:00
parent da56b4ea64
commit 4c06f00555
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
2 changed files with 34 additions and 4 deletions

View file

@ -21836,6 +21836,10 @@ The hook functions are defined here: [[#h:34506761-06b9-43b5-a818-506d9b3faf28][
(setq mu4e-mu-binary (executable-find "mu")) (setq mu4e-mu-binary (executable-find "mu"))
(setq mu4e-hide-index-messages t) (setq mu4e-hide-index-messages t)
;; this is so that messages that target multiple addresses still are individually shown in the unreads
;; this is needed because otherwise after closing the view there will still be an unread message
(setq mu4e-search-skip-duplicates nil)
(setq mu4e-update-interval 60) (setq mu4e-update-interval 60)
(setq mu4e-get-mail-command "mbsync -a") (setq mu4e-get-mail-command "mbsync -a")
(setq mu4e-maildir "~/Mail") (setq mu4e-maildir "~/Mail")
@ -21885,9 +21889,20 @@ This adds the simple utility of sending desktop notifications whenever a new mai
(use-package mu4e-alert (use-package mu4e-alert
:config :config
(setq mu4e-alert-set-default-style 'libnotify)) (mu4e-alert-enable-notifications)
(mu4e-alert-set-default-style 'libnotify)
(setq mu4e-alert-interesting-mail-query
(concat "(maildir:/leon/Inbox AND date:today..now"
" OR maildir:/work/Inbox AND date:today..now)"
" AND flag:unread"))
(alert-add-rule
:category "mu4e-alert"
:predicate (lambda (_) (string-match-p "^mu4e-" (symbol-name major-mode)))
:continue t)
(add-hook 'after-init-hook #'mu4e-alert-enable-notifications)
(add-hook 'after-init-hook #'mu4e-alert-enable-notifications)
)
(mu4e t) (mu4e t)
#+end_src #+end_src

View file

@ -1564,6 +1564,10 @@ create a new one."
(setq mu4e-mu-binary (executable-find "mu")) (setq mu4e-mu-binary (executable-find "mu"))
(setq mu4e-hide-index-messages t) (setq mu4e-hide-index-messages t)
;; this is so that messages that target multiple addresses still are individually shown in the unreads
;; this is needed because otherwise after closing the view there will still be an unread message
(setq mu4e-search-skip-duplicates nil)
(setq mu4e-update-interval 60) (setq mu4e-update-interval 60)
(setq mu4e-get-mail-command "mbsync -a") (setq mu4e-get-mail-command "mbsync -a")
(setq mu4e-maildir "~/Mail") (setq mu4e-maildir "~/Mail")
@ -1603,9 +1607,20 @@ create a new one."
(use-package mu4e-alert (use-package mu4e-alert
:config :config
(setq mu4e-alert-set-default-style 'libnotify)) (mu4e-alert-enable-notifications)
(mu4e-alert-set-default-style 'libnotify)
(setq mu4e-alert-interesting-mail-query
(concat "(maildir:/leon/Inbox AND date:today..now"
" OR maildir:/work/Inbox AND date:today..now)"
" AND flag:unread"))
(alert-add-rule
:category "mu4e-alert"
:predicate (lambda (_) (string-match-p "^mu4e-" (symbol-name major-mode)))
:continue t)
(add-hook 'after-init-hook #'mu4e-alert-enable-notifications)
(add-hook 'after-init-hook #'mu4e-alert-enable-notifications)
)
(mu4e t) (mu4e t)