mu4e: notify when messages are updated
This commit is contained in:
parent
fa7ea8cc0c
commit
96dab3dbb0
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue