diff --git a/.emacs.d/mu4e.el b/.emacs.d/mu4e.el index b1d961a..557e50e 100644 --- a/.emacs.d/mu4e.el +++ b/.emacs.d/mu4e.el @@ -4,7 +4,15 @@ (unless (file-exists-p mu4e-path) (throw 'mu4e-load-path "cannot locate mu4e load path")) (add-to-list 'load-path mu4e-path)) + (require 'mu4e) + +(defun mu4e-notify-new-messages () + (let ((message-count (plist-get mu4e-index-update-status :updated))) + (unless (eq message-count 0) + (shell-command (format "notify-send mu4e \"%d new messages\"" + message-count))))) + (setq mu4e-maildir "~/mail" mu4e-get-mail-command "mbsync -a" mu4e-update-interval (* 5 60) @@ -16,6 +24,7 @@ mu4e-maildir-shortcuts '(("/Inbox" . ?i) ("/Archive" . ?a) ("/Drafts" . ?d))) +(add-hook 'mu4e-index-updated-hook 'mu4e-notify-new-messages) (global-set-key (kbd "C-c m") 'mu4e) ;; smtp