Split mu4e config to be more readable

Remove mu4e-alert, using mu4e builtin modeline and notification
support

Add mu4e iCalendar integration
This commit is contained in:
Evie Litherland-Smith 2024-01-03 13:10:32 +00:00
parent ceb5b1f4c9
commit 3863a5ecef

View file

@ -1040,8 +1040,9 @@ Set fill column to 88 and enable display in python buffers
message-send-mail-function #'message-send-mail-with-sendmail message-send-mail-function #'message-send-mail-with-sendmail
message-auto-save-directory nil message-auto-save-directory nil
message-kill-buffer-on-exit t message-kill-buffer-on-exit t
mail-user-agent 'mu4e-user-agent mail-user-agent 'mu4e-user-agent)
read-mail-command 'mu4e)
(set-variable read-mail-command 'mu4e)
(use-package mu4e (use-package mu4e
:bind (("C-c m" . mu4e) :bind (("C-c m" . mu4e)
@ -1089,13 +1090,64 @@ Set fill column to 88 and enable display in python buffers
list list
personal)) personal))
:config :config
(setq (setq mu4e-use-fancy-chars t)
mu4e-use-fancy-chars t
mu4e-modeline-all-read '("R:" . "󰑇 ") )
#+END_SRC
*** Account contexts
#+begin_src emacs-lisp
(with-eval-after-load 'mu4e
(require 'mu4e-context)
(setq mu4e-contexts
(list
(make-mu4e-context
:name "Xenia"
:vars '((user-mail-address . "evie@xenia.me.uk")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "Proton"
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "iCloud"
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent Messages")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Deleted Messages")
(mu4e-refile-folder . "/iCloud/Archive")))
(make-mu4e-context
:name "Work"
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "evie.litherland-smith@ukaea.uk")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))))))
#+end_src
*** Modeline configuration
#+begin_src emacs-lisp
(with-eval-after-load 'mu4e
(require 'mu4e-modeline)
(setq mu4e-modeline-all-read '("R:" . "󰑇 ")
mu4e-modeline-all-clear '("C:" . "󰚭 ") mu4e-modeline-all-clear '("C:" . "󰚭 ")
mu4e-modeline-new-items '("N:" . "󰎔 ") mu4e-modeline-new-items '("N:" . "󰎔 ")
mu4e-modeline-unread-items '("U:" . "󰶊 ") mu4e-modeline-unread-items '("U:" . "󰶊 "))
mu4e-search-full-label '("F" . "󱊖 ") (mu4e-modeline-mode +1))
#+end_src
*** Headers mode glyphs
#+begin_src emacs-lisp
(with-eval-after-load 'mu4e
(setq mu4e-search-full-label '("F" . "󱊖 ")
mu4e-search-hide-label '("H" . "󰘓 ") mu4e-search-hide-label '("H" . "󰘓 ")
mu4e-search-related-label '("R" . "󰻧 ") mu4e-search-related-label '("R" . "󰻧 ")
mu4e-search-skip-duplicates-label '("D" . "󰆑 ") mu4e-search-skip-duplicates-label '("D" . "󰆑 ")
@ -1123,8 +1175,13 @@ Set fill column to 88 and enable display in python buffers
mu4e-headers-thread-connection-prefix '("│ " . "│ ") mu4e-headers-thread-connection-prefix '("│ " . "│ ")
mu4e-headers-thread-first-child-prefix '("├>" . "├▶") mu4e-headers-thread-first-child-prefix '("├>" . "├▶")
mu4e-headers-thread-child-prefix '("├>" . "├▶") mu4e-headers-thread-child-prefix '("├>" . "├▶")
mu4e-headers-thread-last-child-prefix '("└>" . "╰▶") mu4e-headers-thread-last-child-prefix '("└>" . "╰▶")))
mu4e-marks '((refile :char #+end_src
**** Custom marks
#+begin_src emacs-lisp
(with-eval-after-load 'mu4e
(setq mu4e-marks '((refile :char
("r" . "󰀼 ") ("r" . "󰀼 ")
:prompt "refile" :dyn-target :prompt "refile" :dyn-target
(lambda (lambda
@ -1233,49 +1290,29 @@ Set fill column to 88 and enable display in python buffers
(something :char (something :char
("*" . "󱗿 ") ("*" . "󱗿 ")
:prompt "*something" :action :prompt "*something" :action
(mu4e-error "No action for deferred mark")))) (mu4e-error "No action for deferred mark")))))
(require 'mu4e-org) #+end_src
(setq mu4e-contexts
(list
(make-mu4e-context
:name "Xenia"
:vars '((user-mail-address . "evie@xenia.me.uk")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "Proton"
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive")))
(make-mu4e-context
:name "iCloud"
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent Messages")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Deleted Messages")
(mu4e-refile-folder . "/iCloud/Archive")))
(make-mu4e-context
:name "Work"
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "evie.litherland-smith@ukaea.uk")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))))))
(use-package mu4e-alert *** Desktop notifications
:after (mu4e alert) #+begin_src emacs-lisp
:config (with-eval-after-load 'mu4e
(mu4e-alert-set-default-style 'libnotify) (require 'mu4e-notification)
(mu4e-alert-enable-notifications)) (setq mu4e-notification-support t))
#+end_src
#+END_SRC *** Org-mode integration
#+begin_src emacs-lisp
(with-eval-after-load 'mu4e
(require 'mu4e-org))
#+end_src
*** iCalendar integration
#+begin_src emacs-lisp
(with-eval-after-load 'mu4e
(require 'mu4e-icalendar)
(mu4e-icalendar-setup)
(setq mu4e-icalendar-trash-after-reply nil))
#+end_src
** TODO Feeds ** TODO Feeds
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp