2024-02-15 08:18:41 +00:00
|
|
|
#+title: Internet Config
|
|
|
|
#+author: Evie Litherland-Smith
|
|
|
|
#+email: evie@xenia.me.uk
|
|
|
|
#+filetags: :emacs:config:org:
|
2024-02-15 08:45:37 +00:00
|
|
|
#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent
|
2024-02-15 12:01:36 +00:00
|
|
|
* Email
|
2024-02-15 08:18:41 +00:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq sendmail-program (executable-find "msmtp")
|
|
|
|
send-mail-function #'sendmail-send-it
|
|
|
|
message-send-mail-function #'message-send-mail-with-sendmail
|
|
|
|
message-sendmail-f-is-evil t
|
|
|
|
message-sendmail-extra-arguments '("--read-envelope-from")
|
|
|
|
message-auto-save-directory nil
|
|
|
|
message-kill-buffer-on-exit t
|
|
|
|
mail-user-agent 'mu4e-user-agent)
|
|
|
|
|
|
|
|
(set-variable read-mail-command 'mu4e)
|
|
|
|
|
|
|
|
(use-package mu4e
|
|
|
|
:bind
|
|
|
|
(("C-c m" . mu4e)
|
|
|
|
:map mu4e-view-mode-map
|
|
|
|
("o n" . mu4e-org-store-and-capture))
|
|
|
|
:custom
|
|
|
|
(mu4e-completing-read-function #'completing-read-default)
|
|
|
|
(mu4e-split-view nil)
|
|
|
|
(mu4e-attachment-dir "~/Downloads")
|
|
|
|
(mu4e-get-mail-command "mbsync -a")
|
|
|
|
(mu4e-update-interval (* 5 60)) ; Every 5 minutes
|
|
|
|
(mu4e-headers-auto-update nil)
|
|
|
|
(mu4e-sent-messages-behavior 'sent)
|
|
|
|
(mu4e-change-filenames-when-moving t)
|
|
|
|
(mu4e-context-policy 'pick-first)
|
|
|
|
(mu4e-compose-context-policy 'ask)
|
|
|
|
(mu4e-search-full nil)
|
|
|
|
(mu4e-search-include-related t)
|
|
|
|
(mu4e-search-threads t)
|
|
|
|
(mu4e-search-skip-duplicates t)
|
|
|
|
(mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
|
|
|
|
(:maildir "/iCloud/Inbox/" :key ?i)
|
|
|
|
(:maildir "/Outlook/Inbox/" :key ?w)))
|
|
|
|
(mu4e-bookmarks '((:name "Inbox" :query "maildir:/inbox/" :key ?i :favorite t)
|
|
|
|
(:name "Today" :query "date:today..now AND maildir:/inbox/" :key ?t)
|
|
|
|
(:name "Flagged" :query "flag:flagged AND NOT flag:trashed AND NOT maildir:/spam/ AND NOT maildir:/junk/" :key ?f)
|
|
|
|
(:name "Spam" :query "maildir:/spam/ OR maildir:/junk/" :key ?s :hide-unread t)))
|
|
|
|
(mu4e-headers-fields
|
|
|
|
'((:human-date . 8)
|
|
|
|
(:from . 24)
|
|
|
|
(:subject . 64)
|
|
|
|
(:flags)))
|
|
|
|
(mu4e-headers-visible-flags
|
|
|
|
'(draft
|
|
|
|
flagged
|
|
|
|
unread
|
|
|
|
passed
|
|
|
|
replied
|
|
|
|
trashed
|
|
|
|
attach
|
|
|
|
calendar
|
|
|
|
encrypted
|
|
|
|
signed
|
|
|
|
list
|
|
|
|
personal))
|
|
|
|
:config
|
|
|
|
(setq mu4e-use-fancy-chars t)
|
|
|
|
|
|
|
|
)
|
|
|
|
#+end_src
|
2024-02-15 12:01:36 +00:00
|
|
|
** Account contexts
|
2024-02-15 08:18:41 +00:00
|
|
|
#+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
|
|
|
|
|
2024-02-15 12:01:36 +00:00
|
|
|
** Modeline configuration
|
2024-02-15 08:18:41 +00:00
|
|
|
#+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-new-items '("N:" . " ")
|
|
|
|
mu4e-modeline-unread-items '("U:" . " "))
|
|
|
|
(mu4e-modeline-mode +1))
|
|
|
|
#+end_src
|
|
|
|
|
2024-02-15 12:01:36 +00:00
|
|
|
** Headers mode glyphs
|
2024-02-15 08:18:41 +00:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(with-eval-after-load 'mu4e
|
|
|
|
(setq mu4e-search-full-label '("F" . " ")
|
|
|
|
mu4e-search-hide-label '("H" . " ")
|
|
|
|
mu4e-search-related-label '("R" . " ")
|
|
|
|
mu4e-search-skip-duplicates-label '("D" . " ")
|
|
|
|
mu4e-search-threaded-label'("T" . " ")
|
|
|
|
mu4e-headers-draft-mark '("D" . " ")
|
|
|
|
mu4e-headers-flagged-mark '("F" . " ")
|
|
|
|
mu4e-headers-unread-mark '("u" . " ")
|
|
|
|
mu4e-headers-passed-mark '("P" . " ")
|
|
|
|
mu4e-headers-replied-mark '("R" . " ")
|
|
|
|
mu4e-headers-trashed-mark '("T" . " ")
|
|
|
|
mu4e-headers-attach-mark '("a" . " ")
|
|
|
|
mu4e-headers-calendar-mark '("c" . " ")
|
|
|
|
mu4e-headers-encrypted-mark '("x" . " ")
|
|
|
|
mu4e-headers-signed-mark '("s" . " ")
|
|
|
|
mu4e-headers-list-mark '("l" . " ")
|
|
|
|
mu4e-headers-personal-mark '("p" . " ")
|
|
|
|
mu4e-headers-seen-mark '("S" . " ")
|
|
|
|
mu4e-headers-new-mark '("N" . " ")
|
|
|
|
mu4e-headers-from-or-to-prefix '(" " . "To ")
|
|
|
|
mu4e-headers-thread-root-prefix '("* " . "* ")
|
|
|
|
mu4e-headers-thread-duplicate-prefix '("= " . "= ")
|
|
|
|
mu4e-headers-thread-blank-prefix '(" " . " ")
|
|
|
|
mu4e-headers-thread-single-orphan-prefix '("─>" . "─>")
|
|
|
|
mu4e-headers-thread-orphan-prefix '("┬>" . "┬>")
|
|
|
|
mu4e-headers-thread-connection-prefix '("│ " . "│ ")
|
|
|
|
mu4e-headers-thread-first-child-prefix '("├>" . "├>")
|
|
|
|
mu4e-headers-thread-child-prefix '("├>" . "├>")
|
|
|
|
mu4e-headers-thread-last-child-prefix '("└>" . "╰>")))
|
|
|
|
#+end_src
|
|
|
|
|
2024-02-15 12:01:36 +00:00
|
|
|
*** Custom marks
|
2024-02-15 08:18:41 +00:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(with-eval-after-load 'mu4e
|
|
|
|
(setq mu4e-marks '((refile :char
|
|
|
|
("r" . " ")
|
|
|
|
:prompt "refile" :dyn-target
|
|
|
|
(lambda
|
|
|
|
(target msg)
|
|
|
|
(mu4e-get-refile-folder msg))
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid
|
|
|
|
(mu4e--mark-check-target target)
|
|
|
|
"-N")))
|
|
|
|
(delete :char
|
|
|
|
("D" . " ")
|
|
|
|
:prompt "Delete" :show-target
|
|
|
|
(lambda
|
|
|
|
(target)
|
|
|
|
"delete")
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-remove docid)))
|
|
|
|
(flag :char
|
|
|
|
("+" . " ")
|
|
|
|
:prompt "+flag" :show-target
|
|
|
|
(lambda
|
|
|
|
(target)
|
|
|
|
"flag")
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid nil "+F-u-N")))
|
|
|
|
(move :char
|
|
|
|
("m" . " ")
|
|
|
|
:prompt "move" :ask-target mu4e--mark-get-move-target :action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid
|
|
|
|
(mu4e--mark-check-target target)
|
|
|
|
"-N")))
|
|
|
|
(read :char
|
|
|
|
("!" . " ")
|
|
|
|
:prompt "!read" :show-target
|
|
|
|
(lambda
|
|
|
|
(target)
|
|
|
|
"read")
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid nil "+S-u-N")))
|
|
|
|
(trash :char
|
|
|
|
("d" . " ")
|
|
|
|
:prompt "dtrash" :dyn-target
|
|
|
|
(lambda
|
|
|
|
(target msg)
|
|
|
|
(mu4e-get-trash-folder msg))
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid
|
|
|
|
(mu4e--mark-check-target target)
|
|
|
|
"+T-N")))
|
|
|
|
(unflag :char
|
|
|
|
("-" . " ")
|
|
|
|
:prompt "-unflag" :show-target
|
|
|
|
(lambda
|
|
|
|
(target)
|
|
|
|
"unflag")
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid nil "-F-N")))
|
|
|
|
(untrash :char
|
|
|
|
("=" . " ")
|
|
|
|
:prompt "=untrash" :show-target
|
|
|
|
(lambda
|
|
|
|
(target)
|
|
|
|
"untrash")
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid nil "-T")))
|
|
|
|
(unread :char
|
|
|
|
("?" . " ")
|
|
|
|
:prompt "?unread" :show-target
|
|
|
|
(lambda
|
|
|
|
(target)
|
|
|
|
"unread")
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg target)
|
|
|
|
(mu4e--server-move docid nil "-S+u-N")))
|
|
|
|
(unmark :char " " :prompt "unmark" :action
|
|
|
|
(mu4e-error "No action for unmarking"))
|
|
|
|
(action :char
|
|
|
|
("a" . " ")
|
|
|
|
:prompt "action" :ask-target
|
|
|
|
(lambda nil
|
|
|
|
(mu4e-read-option "Action: " mu4e-headers-actions))
|
|
|
|
:action
|
|
|
|
(lambda
|
|
|
|
(docid msg actionfunc)
|
|
|
|
(save-excursion
|
|
|
|
(when
|
|
|
|
(mu4e~headers-goto-docid docid)
|
|
|
|
(mu4e-headers-action actionfunc)))))
|
|
|
|
(something :char
|
|
|
|
("*" . " ")
|
|
|
|
:prompt "*something" :action
|
|
|
|
(mu4e-error "No action for deferred mark")))))
|
|
|
|
#+end_src
|
|
|
|
|
2024-02-15 12:01:36 +00:00
|
|
|
** Desktop notifications
|
2024-02-15 08:18:41 +00:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(with-eval-after-load 'mu4e
|
|
|
|
(require 'mu4e-notification)
|
|
|
|
(setq mu4e-notification-support t))
|
|
|
|
#+end_src
|
|
|
|
|
2024-02-15 12:01:36 +00:00
|
|
|
** Org-mode integration
|
2024-02-15 08:18:41 +00:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(with-eval-after-load 'mu4e
|
|
|
|
(require 'mu4e-org))
|
|
|
|
#+end_src
|
|
|
|
|
2024-02-15 12:01:36 +00:00
|
|
|
** iCalendar integration
|
2024-02-15 08:18:41 +00:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(with-eval-after-load 'mu4e
|
|
|
|
(require 'mu4e-icalendar)
|
|
|
|
(mu4e-icalendar-setup)
|
|
|
|
(setq mu4e-icalendar-trash-after-reply nil)
|
|
|
|
(require 'gnus-icalendar)
|
|
|
|
(setq gnus-icalendar-org-capture-file (expand-file-name "calendar.org" org-directory))
|
|
|
|
(setq gnus-icalendar-org-capture-headline '("Inbox"))
|
|
|
|
(gnus-icalendar-org-setup))
|
|
|
|
#+end_src
|
|
|
|
|
2024-02-15 12:01:36 +00:00
|
|
|
* Feeds
|
2024-02-15 08:18:41 +00:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package elfeed
|
|
|
|
:bind (("C-c f f" . elfeed)
|
|
|
|
("C-c f u" . elfeed-update))
|
|
|
|
:hook (elfeed-search-mode . elfeed-update)
|
2024-02-17 09:27:50 +00:00
|
|
|
:custom
|
|
|
|
(elfeed-search-filter "@2-weeks-ago +unread")
|
2024-02-15 08:18:41 +00:00
|
|
|
:config
|
2024-02-16 06:24:17 +00:00
|
|
|
(require 'elfeed-org)
|
|
|
|
(require 'elfeed-tube)
|
|
|
|
(require 'elfeed-tube-mpv))
|
2024-02-17 19:20:12 +00:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** elfeed-org
|
|
|
|
|
|
|
|
Manage elfeed subscriptions in an org-mode file instead of elisp.
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
2024-02-16 06:24:17 +00:00
|
|
|
(use-package elfeed-org
|
|
|
|
:ensure t
|
2024-02-17 19:20:12 +00:00
|
|
|
:after (elfeed org)
|
|
|
|
:custom
|
|
|
|
(rmh-elfeed-org-files (list (expand-file-name "feeds.org" org-directory)))
|
2024-02-16 06:24:17 +00:00
|
|
|
:config
|
|
|
|
(elfeed-org))
|
2024-02-17 19:20:12 +00:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** elfeed-tube
|
|
|
|
|
|
|
|
Use elfeed for YouTube subscriptions, including getting video transcripts.
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
2024-02-16 06:24:17 +00:00
|
|
|
(use-package elfeed-tube
|
|
|
|
:ensure t
|
|
|
|
:after elfeed
|
|
|
|
:config
|
|
|
|
(setq elfeed-tube-auto-save-p nil)
|
|
|
|
(setq elfeed-tube-auto-fetch-p t)
|
|
|
|
(elfeed-tube-setup)
|
|
|
|
:bind ( :map elfeed-show-mode-map
|
|
|
|
("F" . elfeed-tube-fetch)
|
|
|
|
([remap save-buffer] . elfeed-tube-save)
|
|
|
|
:map elfeed-search-mode-map
|
|
|
|
("F" . elfeed-tube-fetch)
|
|
|
|
([remap save-buffer] . elfeed-tube-save)))
|
|
|
|
(use-package elfeed-tube-mpv
|
|
|
|
:ensure t
|
|
|
|
:after elfeed-tube
|
|
|
|
:init (require 'mpv)
|
|
|
|
:bind ( :map elfeed-show-mode-map
|
|
|
|
("C-c C-f" . elfeed-tube-mpv-follow-mode)
|
|
|
|
("C-c C-w" . elfeed-tube-mpv-where)))
|
2024-02-15 08:18:41 +00:00
|
|
|
#+end_src
|