Skip to content

Commit

Permalink
Removed Mastodon and NotMuch; we are not a kitchen sink :)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacmoe committed Oct 11, 2023
1 parent f83552d commit 535c6d2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 187 deletions.
140 changes: 0 additions & 140 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -141,146 +141,6 @@ For Unicode emojis, install an emoji font like [[http://legionfonts.com/fonts/se

If you want to use your own fonts, do change the configuration, around line 90 in ~config.el~.

*** Email
In order to read email with Emacs, we need to install and configure =offlineimap= for synchronizing with the remote email server, =notmuch= for tagging the email, and =msmtp= for sending email.

The following assumes that you are using Gmail. If you are not, see this article: [[https://www.maketecheasier.com/use-email-within-emacs/][How to Use Email within Emacs - Make Tech Easier]]

**** Google
We need to generate an application password here: [[https://myaccount.google.com/apppasswords][Application Passwords - Google Account]]

Choose application password for “Mail”, and write the password down.

**** Offlineimap
#+begin_src bash
sudo pacman -S offlineimap
#+end_src

Create a file called =.offlineimaprc= in your home directory, with the following contents:
#+begin_src conf
[general]
accounts = gmailaccount

[Account gmailaccount]
localrepository = localgmail
remoterepository = remotegmail
postsynchook = ~/mail/postsync.sh # notmuch tagging script
utf8foldernames = yes

[Repository localgmail]
type = GmailMaildir
localfolders = /home/username/mail/[email protected]

[Repository remotegmail]
type = Gmail
maxconnections=1
remotehost = imap.gmail.com
remoteuser = [email protected]
remotepass = PASSWORD
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
#+end_src

Now run Offlineimap:
#+begin_src bash
offlineimap
#+end_src
It should, hopefully, download the email into ~/home/username/mail/username@gmail/~.
**** Notmuch
#+begin_src bash
sudo pacman -S notmuch
#+end_src

The =.notmuch-config= file in my home directory:
#+begin_src conf
# .notmuch-config - Configuration file for the notmuch mail system
# Database configuration
[database]

# User configuration
[user]
[email protected]

# Configuration for "notmuch new"
[new]
tags=inbox;unread;
ignore=

# Search configuration
[search]
exclude_tags = junk;deleted;

# Maildir compatibility configuration
[maildir]
synchronize_flags=true
#+end_src

Now we need to create an =Offlineimap= postsync hook so that it can run =notmuch new= after synchronizing with the remote email server.

Create a file called =postsync.sh= in ~/home/username/mail/~:
#+begin_src bash
#!/usr/bin/env bash
# ~/mail/postsync.sh

# tag_new <tags> <search-term>
function tag_new { notmuch tag $1 -- tag:inbox and $2; }

# blacklist <search-term>
function blacklist { tag_new "-inbox -unread +deleted" $1; }

# spam <search-term>
function spam { tag_new "-inbox -unread +spam +deleted" $1; }

# security <search-term>
function security { tag_new "-inbox +Security" $1; }

# update : let notmuch process new mails
notmuch new
#+end_src
Make the file executable:
#+begin_src bash
chmod +x postsync.sh
#+end_src

**** msmtp
#+begin_src bash
sudo pacman -S msmtp
#+end_src
Create a file called =.msmtprc= in your home directory:
#+begin_src conf
# Set default values for all following accounts.
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log

# Gmail
account gmail
host smtp.gmail.com
port 465
tls_starttls off
from [email protected]
user username
password PASSWORD

# Set a default account
account default : gmail
#+end_src
Set the correct permissions on the file:
#+begin_src bash
chmod 600 .msmtprc
#+end_src
See this wiki article for reference: [[https://wiki.archlinux.org/title/Msmtp#Basic_setup][msmtp - ArchWiki]]

**** Notmuch Address Lookup tool
To aid in looking up email addresses for auto-completion, we need to download (via git) and compile an address lookup tool coded in C.
#+begin_src bash
git clone [email protected]:aperezdc/notmuch-addrlookup-c.git
cd notmuch-addrlookup-c
make
#+end_src
See [[https://github.com/aperezdc/notmuch-addrlookup-c][aperezdc/notmuch-addrlookup-c]] for details.
*** Maim and Gifsicle
For creating gif screencasts, we use Maim and Gifsicle. Install =maim= and =gifsicle= using your package manager of choice.
#+begin_src bash
Expand Down
40 changes: 0 additions & 40 deletions config.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"~/enestaaende/enestaaende.org"
"~/Dropbox/skriv/habits/habits.org"))

(defvar my-notmuch-address-command "/home/moena/notmuch-addrlookup-c/notmuch-addrlookup")
(defvar my-puppeteer-config-file "/home/moena/puppeteerConfigFile.json")
(defvar my-flymake-vale-executable "/home/moena/bin/vale")

Expand All @@ -73,9 +72,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq user-full-name "Jacob Moena"
user-mail-address "[email protected]"
user-mail-domain "gmail.com"
user-instance-url "https://writing.exchange"
mastodon-username "@jacmoe"
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -195,7 +191,6 @@
(remove-hook 'doom-first-buffer-hook #'global-hl-line-mode) ; Do not highlight current line
(setq global-page-break-lines-mode t) ; Pretty page breaks everywhere
(setq confirm-kill-processes nil) ; Don't ask to kill running processes when exiting Emacs.
(setq +notmuch-sync-backend 'offlineimap)
(add-hook 'text-mode-hook (lambda () (setq-local line-spacing 0.1))) ; Setting a more comfortable line spacing for prose

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -314,8 +309,6 @@
;; Emacs-everywhere
;; Atomic-chrome
;; Engine-mode
;; Mastodon
;; Smtpmail
;; Keycast
;; Gif-screencast
;; Olivetti-mode
Expand Down Expand Up @@ -976,39 +969,6 @@
"https://github.com/search?ref=simplesearch&q=%s"
:keybinding "g"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;; Mastodon ;;
;; ;;
;; https://codeberg.org/martianh/mastodon.el ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq mastodon-instance-url user-instance-url
mastodon-active-user mastodon-username
mastodon-toot--download-custom-emoji t
mastodon-toot--enable-custom-emoji t
mastodon-toot--enable-completion t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;; Smtpmail ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq mail-host-address user-mail-domain)
(setq user-full-name user-full-name)
(setq user-mail-adress user-mail-address)
(setq mail-user-agent 'message-user-agent)
(setq message-send-mail-function 'message-send-mail-with-sendmail)
(setq message-kill-buffer-on-exit t)
(setq mail-specify-envelope-from t)
(setq sendmail-program "/usr/bin/msmtp"
mail-specify-envelope-from t
mail-envelope-from 'header
message-sendmail-envelope-from 'header)

(require 'notmuch-address)
(setq notmuch-address-command my-notmuch-address-command)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;; Keycast ;;
Expand Down
6 changes: 3 additions & 3 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
rgb ; creating color strings
rgb ; creating color strings
taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
Expand Down Expand Up @@ -183,13 +183,13 @@

:email
;;(mu4e +org +gmail)
notmuch
;; notmuch
;;(wanderlust +gmail)

:app
;;calendar
;;emms
everywhere ; *leave* Emacs!? You must be joking
everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
Expand Down
4 changes: 0 additions & 4 deletions packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@

(package! org-analyzer)

(package! mastodon)

(package! define-word)

(package! mermaid-mode)
Expand All @@ -66,8 +64,6 @@

;; (package! org-habit-stats)

(package! poet-theme)

(package! mixed-pitch)

(package! elpher)
Expand Down

0 comments on commit 535c6d2

Please sign in to comment.