Compare commits

...

9 commits

Author SHA1 Message Date
e84584fb0d
wezterm: Remove emoji picker key bind
I use my own 'bemoji' picker everywhere, including wezterm.
2025-09-24 08:25:02 +02:00
e0a8db1194
aerc: Enable mailto functionality for aerc
Explanation here:
https://man.sr.ht/~rjarry/aerc/configurations/mailto.md

I built a custom script 'aerc-in-terminal' since I want to expand the
$TERMINAL env var and use that instead. `.desktop` files do not allow
expanding vars (since they don't run in a user shell), so this is a
compromise.
2025-09-24 08:25:02 +02:00
4328cbba39
notmuch: Remove move-and-untag pre hook 2025-09-24 08:25:01 +02:00
c130b2a6b6
notmuch: Update hooks 2025-09-24 08:25:01 +02:00
38b02f5680
aerc: Add notmuch inbox mapping
Some simple mapping (inbox, sent, trash, archive, drafts) to the
Personal map file, with the option to extend for private mappings with
dotter.
2025-09-24 08:25:00 +02:00
547e9e9971
aerc: Add mail type formatting
Mails get symbols in the flag column if they are sent by me, CC or BCC
me, or they are tagged as a 'list' (from a mailing list).

Added some additional info to status bar (current folder, recent and
unread counts), and extended the flag column slightly to accomodate more
flags.
2025-09-24 08:25:00 +02:00
a735c209f5
aerc: Add flag formatting 2025-09-24 08:24:59 +02:00
54ee018021
aerc: Add configuration to replace neomutt usage
Starting to replace neomutt in my workflow with aerc:
it is a little more lightweight, directly supports notmuch directories
and has a relatively sane configuration style (mostly just ini-like)
with 'go-templating' baked in.

In general, the configuration just feels less 'cobbled-together' than
before. I can make changes without worrying what other things are going
to break by doing so. I understand the complete configuration and
styling, instead of mostly relying on other people's formatting lines
for the styles.

I am still learning some of the configuration possibilities but it
already functions as a neomutt replacement.
2025-09-24 08:24:59 +02:00
8fdffef644
aerc: Add accounts configuration template
Uses private from-email and email aliases fields.
2025-09-24 08:24:58 +02:00
12 changed files with 420 additions and 2 deletions

View file

@ -59,6 +59,9 @@ pass = "~"
"office/.config/goimapnotify/goimapnotify.yaml" = { target = "~/.config/goimapnotify/goimapnotify.yaml", type = "template" }
"office/.config/isync/mbsyncrc" = { target = "~/.config/isync/mbsyncrc", type = "template" }
"office/.config/msmtp/config" = { target = "~/.config/msmtp/config", type = "template" }
"office/.config/aerc/accounts.conf" = { target = "~/.config/aerc/accounts.conf", type = "template" }
"office/.config/aerc/Personal.qmap" = { target = "~/.config/aerc/Personal.qmap", type = "template" }
"office/.config/notmuch/default/hooks/post-new" = { target = "~/.config/notmuch/default/hooks/post-new", type = "template" }
"office/.config/neomutt/account" = { target = "~/.config/neomutt/account", type = "template" }
"office/.config/neomutt/profile.gmail" = { target = "~/.config/neomutt/profile.gmail", type = "template" }
"office/.config/neomutt/profile.private" = { target = "~/.config/neomutt/profile.private", type = "template" }

View file

@ -23,3 +23,10 @@ mail_personal_password_cmd = ""
mail_notmuch_name = ""
mail_notmuch_primary_email = ""
mail_notmuch_other_email = ""
mail_notmuch_hook_labels = [
"+list -- from:notifications@github.com"
]
mail_aerc_from_email = ""
mail_aerc_aliases_email = ""
mail_aerc_notmuch_label_map = ["list = tag:list and not tag:trash"]

View file

@ -0,0 +1,16 @@
Inbox = tag:inbox AND not tag:list
Archive = tag:archive AND not tag:junk AND not tag:spam
All = '*'
Drafts = tag:draft
Sent = tag:sent
Trash = tag:trash
# tags
label/unread = tag:unread and not tag:trash
label/replied = tag:replied and not tag:trash
label/important = tag:flagged or tag:important and not tag:trash
label/junk = tag:junk and not tag:trash
{{#each mail_aerc_notmuch_label_map}}
{{this}}
{{/each}}

View file

@ -0,0 +1,21 @@
[Personal]
source = notmuch://~/documents/mail
maildir-store = ~/documents/mail
query-map = ~/.config/aerc/Personal.qmap
default = Inbox
folders-sort = Inbox,Drafts,Sent
check-mail-cmd = neomutt-syncmail
exclude-tags = spam
multi-file-strategy = act-dir-delete-rest
restrict-delete = true
outgoing = msmtp
from = {{with_default mail_aerc_from_email "Jane Doe <mail@jane.doe>"}}
{{#if mail_aerc_aliases_email}}
aliases = {{mail_aerc_aliases_email}}
{{/if}}
use-envelope-from = true
copy-to = Sent
pgp-opportunistic-encrypt = true
address-book-cmd = khard email --parsable --remove-first-line %s

View file

@ -0,0 +1,107 @@
[general]
enable-osc8 = true
[ui]
dirlist-tree = true
fuzzy-complete = true
dialog-position = bottom
styleset-name = simple
index-columns = flags>6,name<20%,subject,date>=
this-week-time-format = Mon 02
sidebar-width = 15
# column-separator = "│"
column-flags = {{.Flags | join ""}} \
{{map .Labels (exclude .Folder) \
(case `^new$` (.Style "" "attention")) \
(case `^unread$` (.Style "" "accent")) \
(case `^attachment$` (.Style "󰁦" "subdued")) \
(case `^replied$` (.Style "↻" "subdued")) \
(case `^forwarded$` (.Style "f" "")) \
(case `^flagged$` (.Style "!" "highlight")) \
(case `^important$` (.Style "" "highlight")) \
(case `^list$` "") \
(default "") \
| join "" }} \
{{if contains .AccountFrom.Address (.From | emails | join ", ")}}{{end}}\
{{if contains .AccountFrom.Address (.Cc | emails | join ", ")}}{{end}}\
{{if contains .AccountFrom.Address (.Bcc | emails | join ", ")}}{{end}}
column-subject = {{(.Style .ThreadPrefix "subdued")}}{{if .ThreadFolded}}{{printf (.Style "%d " "subdued") .ThreadCount}}{{end}}{{.Subject}}
icon-new = ""
icon-old = ""
icon-attachment = ""
icon-replied = ""
icon-forwarded = ""
icon-deleted = ""
icon-flagged = ""
icon-marked = ""
icon-signed = ""
icon-encrypted = ""
icon-unknown = ""
icon-invalid = ""
threading-enabled = true
reverse-thread-order = true
show-thread-context = true
thread-prefix-folded = "+ "
thread-prefix-tip = ""
thread-prefix-indent = ""
thread-prefix-stem = "│"
thread-prefix-limb = "─"
thread-prefix-folded = "+"
thread-prefix-unfolded = ""
thread-prefix-first-child = "┬"
thread-prefix-has-siblings = "├"
thread-prefix-orphan = "┌"
thread-prefix-dummy = "┬"
thread-prefix-lone = " "
thread-prefix-last-sibling = "╰"
[statusline]
column-left = {{.Account}}>{{compactDir .Folder}} {{.ContentInfo}}
column-center = {{.PendingKeys}} # RUE shows 'recent&unread/existing'
column-right = {{.RUE}} | {{.TrayInfo}} | {{cwd}} | {{dateFormat now "Mon Jan 2 15:04:05 2006"}}
[viewer]
[compose]
file-picker-cmd = vifm --choose-files -
reply-to-self = false
empty-subject-warning = true
no-attachment-warning = ^[^>]*(attach(ed|ment)|an(ge)?hang)
[multipart-converters]
text/html=pandoc -f commonmark_x -t html --standalone --embed-resources --template email
# TODO: change to djot when new pandoc version in repos
[filters]
.filename,~.*.ics = calendar
text/plain = wrap -w 100 | colorize
text/calendar = calendar
message/delivery-status = colorize
message/rfc822 = colorize
text/html = pandoc -f html -t plain
application/pdf = pdftotext - -l 10 -nopgbrk -q - | wrap -w 100
application/msword = pandoc -f docx -t plain
application/vnd.openxmlformats-officedocument.wordprocessingml.document = pandoc -f docx -t plain
application/vnd.oasis.opendocument.text = pandoc -f odt -t plain
.headers = colorize
# text/html = ! html # ! for interactive applications
[openers]
# does not have filename checking for openers?
.filename,~.*.ics = wezterm -e nvim -
[hooks]
mail-deleted = notmuch new
mail-added = notmuch new
mail-sent = notmuch new
flag-changed = notmuch new
tag-modified = notmuch new
aerc-shutdown = notmuch new
[templates]

View file

@ -0,0 +1,218 @@
# Binds are of the form <key sequence> = <command to run>
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
gT = :prev-tab<Enter>
gt = :next-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-PgDn> = :next-tab<Enter>
\[t = :prev-tab<Enter>
\]t = :next-tab<Enter>
<C-t> = :term<Enter>
? = :help keys<Enter>
<C-c> = :prompt 'Quit?' quit<Enter>
<C-q> = :prompt 'Quit?' quit<Enter>
<C-z> = :suspend<Enter>
[messages]
q = :quit<Enter> # quick quitting
j = :next<Enter>
\]m = :next<Enter>
<Down> = :next<Enter>
<C-d> = :next 50%<Enter>
<C-f> = :next 100%<Enter>
k = :prev<Enter>
\[m = :prev<Enter>
<Up> = :prev<Enter>
<C-u> = :prev 50%<Enter>
<C-b> = :prev 100%<Enter>
gg = :select 0<Enter>
G = :select -1<Enter>
\]e = :next-folder<Enter>
\[e = :prev-folder<Enter>
\}e = :next-folder -u<Enter>
\{e = :prev-folder -u<Enter>
<C-Down> = :next-folder<Enter>
<C-Up> = :prev-folder<Enter>
H = :collapse-folder<Enter>
L = :expand-folder<Enter>
<C-Left> = :collapse-folder<Enter>
<C-Right> = :expand-folder<Enter>
gi = :cf Inbox<Enter>
gs = :cf Sent<Enter>
gd = :cf Drafts<Enter>
ga = :cf Archive<Enter>
gA = :cf All<Enter>
gr = :cf Trash<Enter>
v = :mark -t<Enter>
V = :mark -V<Enter>
J = :mark -t<Enter>:next<Enter>
K = :mark -t<Enter>:prev<Enter>
T = :prompt "Mark filter: " :mark<Enter>
zt = :toggle-threads<Enter>
zc = :fold<Enter>
zC = :fold -a<Enter>
zo = :unfold<Enter>
zO = :unfold -a<Enter>
za = :fold -t<Enter>
zA = :fold -t -a<Enter>
zz = :align center<Enter>
zt = :align top<Enter>
zb = :align bottom<Enter>
<Enter> = :view<Enter>
l = :view<Enter>
# remove filters
<Space>/ = :filter<Enter>
<Space>\ = :filter<Enter>
,F = :tag<Space>
,s = :tag !unread<Enter>
,u = :tag !urgent<Enter>
,d = :tag !todo<Enter>
,i = :tag !important<Enter>
,f = :tag !flagged<Enter>
,w = :tag !wait<Enter>
,l = :tag !delegated<Enter>
,j = :tag !junk<Enter>
,J = :tag !junk<Enter>:archive flat<Enter> # archive message as junk
<space>s = :filter tag:unread<Enter>
<space>u = :filter tag:urgent<Enter>
<space>d = :filter tag:todo<Enter>
<space>i = :filter tag:important or tag:flagged<Enter>
<space>f = :filter tag:flagged<Enter>
<space>w = :filter tag:wait<Enter>
<space>l = :filter tag:delegated<Enter>
d = :move Trash<Enter>
D = :choose -o y 'Really delete this message' :delete<Enter>
a = :archive flat<Enter> # archive message
A = :unmark -a<Enter>:mark -T<Enter>:archive flat<Enter> # archive thread
M = :menu -d :move<Enter> # move mail
m = :compose<Enter>
f = :forward<Enter>
F = :bounce<space>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
rR = :reply<Enter>
rQ = :reply -q<Enter>
c = :cf<space>
! = :term<space>
| = :pipe<space>
/ = :search<space>
\ = :filter<space>
n = :next-result<Enter>
N = :prev-result<Enter>
<Esc> = :clear<Enter>
s = :split<Enter>
S = :vsplit<Enter>
# send mails to taskwarrior
,t = :pipe -s -m neomutt-2task -c -d -t
,T = :pipe -s -m neomutt-2task -c
# # TODO: Investigate use
# pl = :patch list<Enter>
# pa = :patch apply <Tab>
# pd = :patch drop <Tab>
# pb = :patch rebase<Enter>
# pt = :patch term<Enter>
# ps = :patch switch <Tab>
[messages:folder=Drafts]
m = :recall<Enter>
[messages:folder=Trash]
d = :choose -o y 'Really delete this message' :delete<Enter>
D = :delete<Enter>
[view]
/ = :toggle-key-passthrough<Enter>/
q = :close<Enter>
h = :close<Enter>
O = :open<Enter>
o = :open<Enter>
S = :menu -c 'vifm --choose-dir - --on-choose exit' :save<Enter> # save current with
| = :pipe<space>
d = :move Trash<Enter>
D = :choose -o y 'Really delete this message' :delete<Enter>
a = :archive flat<Enter> # archive message
A = :unmark -a<Enter>:mark -T<Enter>:archive flat<Enter> # archive thread
M = :menu -d :move<Enter> # move mail
<C-y> = :copy-link<space>
<C-u> = :open-link<space>
m = :compose<Enter>
f = :forward<Enter>
F = :bounce<space>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
rR = :reply<Enter>
rQ = :reply -q<Enter>
H = :toggle-headers<Enter>
J = :next-part<Enter>
K = :prev-part<Enter>
<C-Up> = :prev-part<Enter>
<C-Down> = :next-part<Enter>
<C-n> = :next<Enter>
<C-p> = :prev<Enter>
<C-Right> = :next<Enter>
<C-Left> = :prev<Enter>
tr = :pipe trans -show-original n -b -no-autocorrect<Enter> # translate message
[view::passthrough]
$noinherit = true
$ex = <C-x>
<Esc> = :toggle-key-passthrough<Enter>
[compose]
# Keybindings used when the embedded terminal is not selected in the compose view
$noinherit = true
$ex = <C-x>
$complete = <C-o>
<C-Up> = :prev-field<Enter>
<C-Down> = :next-field<Enter>
<C-p> = :prev-field<Enter>
<C-n> = :next-field<Enter>
<tab> = :next-field<Enter>
<backtab> = :prev-field<Enter>
<A-p> = :switch-account -p<Enter>
<A-n> = :switch-account -n<Enter>
<C-Left> = :switch-account -p<Enter>
<C-Right> = :switch-account -n<Enter>
[compose::editor]
# Keybindings used when the embedded terminal is selected in the compose view
$noinherit = true
$ex = <C-x>
[compose::review]
# Keybindings used when reviewing a message to be sent
# Inline comments are used as descriptions on the review screen
y = :send<Enter> # Send
n = :abort<Enter> # Abort (discard message, no confirmation)
s = :sign<Enter> # Toggle signing
x = :encrypt<Enter> # Toggle encryption to all recipients
v = :preview<Enter> # Preview message
p = :postpone<Enter> # Postpone
q = :choose -o d discard abort -o p postpone postpone<Enter> # Abort or postpone
e = :edit<Enter> # Edit (body and headers)
a = :attach -m<Enter> # Add attachment
d = :detach<space> # Remove attachment
[terminal]
$noinherit = true
$ex = <C-x>

View file

@ -0,0 +1,14 @@
# vim: ft=dosini
#
# aerc default styleset
#
# This styleset uses the terminal defaults as its base, by not setting anything.
# For more details see the 'default' styleset in aerc, or the
# aerc-stylesets(7) manpage.
[user]
attention.fg = 1
accent.fg = 4
highlight.fg = 3
subdued.fg = 2
subdued.dim = true

View file

@ -48,8 +48,8 @@ other_email=mo82rimu@studserv.uni-leipzig.de;moehme@ruc.dk;
# in the mail store.
#
[new]
tags=unread;inbox
ignore=.uidvalidity;.mbsyncstate;Trash;Junk
tags=unread;inbox;
ignore=.uidvalidity;.mbsyncstate;
# Search configuration
#

View file

@ -0,0 +1,12 @@
#!/usr/bin/env sh
echo "
-unread -- folder:Trash OR folder:Archive
-unread -flagged -todo -- folder:Trash
{{#each mail_notmuch_hook_labels}}
{{this}}
{{/each}}
" |
notmuch tag --batch

View file

@ -0,0 +1,3 @@
#!/bin/sh
# If the user has set $TERMINAL, use it, otherwise fall back to foot.
exec "${TERMINAL:-foot}" -e --class float aerc "$@"

View file

@ -0,0 +1,16 @@
[Desktop Entry]
Version=1.0
Name=aerc
GenericName=Mail Client
GenericName[de]=Email Client
Comment=Launches the aerc email client
Comment[de]=Startet den aerc Email-Client
Keywords=Email,Mail,IMAP,SMTP
Categories=Office;Network;Email;ConsoleOnly
Type=Application
Icon=utilities-terminal
Terminal=false
Exec=aerc-in-terminal %u
MimeType=x-scheme-handler/mailto

View file

@ -3,6 +3,7 @@ local act = wezterm.action
local keys = {
{ key = "L", mods = "CTRL|SHIFT", action = "DisableDefaultAssignment" },
{ key = "U", mods = "CTRL|SHIFT", action = "DisableDefaultAssignment" },
{ key = "[", mods = "CTRL", action = act.ScrollToPrompt(-1) },
{ key = "]", mods = "CTRL", action = act.ScrollToPrompt(1) },