From 8fdffef644ed42c92dc1df25f5a40c3140f15f56 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Sep 2025 09:58:29 +0200 Subject: [PATCH 1/9] aerc: Add accounts configuration template Uses private from-email and email aliases fields. --- .dotter/global.toml | 1 + .dotter/sample.toml | 3 +++ office/.config/aerc/accounts.conf | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 office/.config/aerc/accounts.conf diff --git a/.dotter/global.toml b/.dotter/global.toml index edcb95d..5fde0a6 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -59,6 +59,7 @@ 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/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" } diff --git a/.dotter/sample.toml b/.dotter/sample.toml index 20b3e15..b834dd2 100644 --- a/.dotter/sample.toml +++ b/.dotter/sample.toml @@ -23,3 +23,6 @@ mail_personal_password_cmd = "" mail_notmuch_name = "" mail_notmuch_primary_email = "" mail_notmuch_other_email = "" + +mail_aerc_from_email = "" +mail_aerc_aliases_email = "" diff --git a/office/.config/aerc/accounts.conf b/office/.config/aerc/accounts.conf new file mode 100644 index 0000000..1e68aa4 --- /dev/null +++ b/office/.config/aerc/accounts.conf @@ -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 "}} +{{#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 From 54ee0180214f1fccb01937a18b081729e57eb126 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 20 Sep 2025 23:15:33 +0200 Subject: [PATCH 2/9] 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. --- office/.config/aerc/aerc.conf | 68 +++++++++ office/.config/aerc/binds.conf | 218 +++++++++++++++++++++++++++ office/.config/aerc/stylesets/simple | 14 ++ 3 files changed, 300 insertions(+) create mode 100644 office/.config/aerc/aerc.conf create mode 100644 office/.config/aerc/binds.conf create mode 100644 office/.config/aerc/stylesets/simple diff --git a/office/.config/aerc/aerc.conf b/office/.config/aerc/aerc.conf new file mode 100644 index 0000000..60361ce --- /dev/null +++ b/office/.config/aerc/aerc.conf @@ -0,0 +1,68 @@ +[general] +enable-osc8 = true + +[ui] +dirlist-tree = true +fuzzy-complete = true +dialog-position = bottom + +styleset-name = simple + +index-columns = flags>4,name<20%,subject,date>= +this-week-time-format = Mon 02 +sidebar-width = 15 + +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}}] {{cwd}} {{.ContentInfo}} +column-right = {{.TrayInfo}} | {{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] + +[templates] diff --git a/office/.config/aerc/binds.conf b/office/.config/aerc/binds.conf new file mode 100644 index 0000000..9400cbd --- /dev/null +++ b/office/.config/aerc/binds.conf @@ -0,0 +1,218 @@ +# Binds are of the form = +# To use '=' in a key sequence, substitute it with "Eq": "" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit +gT = :prev-tab +gt = :next-tab + = :prev-tab + = :next-tab +\[t = :prev-tab +\]t = :next-tab + = :term +? = :help keys + = :prompt 'Quit?' quit + = :prompt 'Quit?' quit + = :suspend + +[messages] +q = :quit # quick quitting + +j = :next +\]m = :next + = :next + = :next 50% + = :next 100% + +k = :prev +\[m = :prev + = :prev + = :prev 50% + = :prev 100% +gg = :select 0 +G = :select -1 + +\]e = :next-folder +\[e = :prev-folder +\}e = :next-folder -u +\{e = :prev-folder -u + = :next-folder + = :prev-folder +H = :collapse-folder +L = :expand-folder + = :collapse-folder + = :expand-folder + +gi = :cf Inbox +gs = :cf Sent +gd = :cf Drafts +ga = :cf Archive +gA = :cf All +gr = :cf Trash + +v = :mark -t +V = :mark -V +J = :mark -t:next +K = :mark -t:prev +T = :prompt "Mark filter: " :mark + +zt = :toggle-threads +zc = :fold +zC = :fold -a +zo = :unfold +zO = :unfold -a +za = :fold -t +zA = :fold -t -a + +zz = :align center +zt = :align top +zb = :align bottom + + = :view +l = :view + +# remove filters +/ = :filter +\ = :filter +,F = :tag +,s = :tag !unread +,u = :tag !urgent +,d = :tag !todo +,i = :tag !important +,f = :tag !flagged +,w = :tag !wait +,l = :tag !delegated +,j = :tag !junk +,J = :tag !junk:archive flat # archive message as junk +s = :filter tag:unread +u = :filter tag:urgent +d = :filter tag:todo +i = :filter tag:important or tag:flagged +f = :filter tag:flagged +w = :filter tag:wait +l = :filter tag:delegated + +d = :move Trash +D = :choose -o y 'Really delete this message' :delete +a = :archive flat # archive message +A = :unmark -a:mark -T:archive flat # archive thread +M = :menu -d :move # move mail + +m = :compose +f = :forward +F = :bounce +rr = :reply -a +rq = :reply -aq +rR = :reply +rQ = :reply -q + +c = :cf +! = :term +| = :pipe + +/ = :search +\ = :filter +n = :next-result +N = :prev-result + = :clear + +s = :split +S = :vsplit + +# 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 +# pa = :patch apply +# pd = :patch drop +# pb = :patch rebase +# pt = :patch term +# ps = :patch switch + +[messages:folder=Drafts] +m = :recall +[messages:folder=Trash] +d = :choose -o y 'Really delete this message' :delete +D = :delete + +[view] +/ = :toggle-key-passthrough/ +q = :close +h = :close +O = :open +o = :open +S = :menu -c 'vifm --choose-dir - --on-choose exit' :save # save current with +| = :pipe + +d = :move Trash +D = :choose -o y 'Really delete this message' :delete +a = :archive flat # archive message +A = :unmark -a:mark -T:archive flat # archive thread +M = :menu -d :move # move mail + + = :copy-link + = :open-link + +m = :compose +f = :forward +F = :bounce +rr = :reply -a +rq = :reply -aq +rR = :reply +rQ = :reply -q + +H = :toggle-headers +J = :next-part +K = :prev-part + = :prev-part + = :next-part + = :next + = :prev + = :next + = :prev + +tr = :pipe trans -show-original n -b -no-autocorrect # translate message + +[view::passthrough] +$noinherit = true +$ex = + = :toggle-key-passthrough + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose view +$noinherit = true +$ex = +$complete = + = :prev-field + = :next-field + = :prev-field + = :next-field + = :next-field + = :prev-field + = :switch-account -p + = :switch-account -n + = :switch-account -p + = :switch-account -n + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = + +[compose::review] +# Keybindings used when reviewing a message to be sent +# Inline comments are used as descriptions on the review screen +y = :send # Send +n = :abort # Abort (discard message, no confirmation) +s = :sign # Toggle signing +x = :encrypt # Toggle encryption to all recipients +v = :preview # Preview message +p = :postpone # Postpone +q = :choose -o d discard abort -o p postpone postpone # Abort or postpone +e = :edit # Edit (body and headers) +a = :attach -m # Add attachment +d = :detach # Remove attachment + +[terminal] +$noinherit = true +$ex = diff --git a/office/.config/aerc/stylesets/simple b/office/.config/aerc/stylesets/simple new file mode 100644 index 0000000..66e8165 --- /dev/null +++ b/office/.config/aerc/stylesets/simple @@ -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 From a735c209f54d5a77438bb4d176d53bf6d43fdf66 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 20 Sep 2025 23:15:33 +0200 Subject: [PATCH 3/9] aerc: Add flag formatting --- office/.config/aerc/aerc.conf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/office/.config/aerc/aerc.conf b/office/.config/aerc/aerc.conf index 60361ce..96cd2ae 100644 --- a/office/.config/aerc/aerc.conf +++ b/office/.config/aerc/aerc.conf @@ -12,6 +12,34 @@ index-columns = flags>4,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")) \ + (default "") \ + | join "" }} + +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 From 547e9e9971a5d862b3feca1c72322ebada6713fa Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Sep 2025 20:17:46 +0200 Subject: [PATCH 4/9] 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. --- office/.config/aerc/aerc.conf | 13 +++++++++---- office/.config/aerc/binds.conf | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/office/.config/aerc/aerc.conf b/office/.config/aerc/aerc.conf index 96cd2ae..3f12fe9 100644 --- a/office/.config/aerc/aerc.conf +++ b/office/.config/aerc/aerc.conf @@ -8,7 +8,7 @@ dialog-position = bottom styleset-name = simple -index-columns = flags>4,name<20%,subject,date>= +index-columns = flags>6,name<20%,subject,date>= this-week-time-format = Mon 02 sidebar-width = 15 @@ -22,8 +22,12 @@ column-flags = {{.Flags | join ""}} \ (case `^forwarded$` (.Style "f" "")) \ (case `^flagged$` (.Style "!" "highlight")) \ (case `^important$` (.Style "" "highlight")) \ + (case `^list$` "") \ (default "") \ - | join "" }} + | 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}} @@ -58,8 +62,9 @@ thread-prefix-lone = " " thread-prefix-last-sibling = "╰" [statusline] -column-left = [{{.Account}}] {{cwd}} {{.ContentInfo}} -column-right = {{.TrayInfo}} | {{dateFormat now "Mon Jan 2 15:04:05 2006"}} +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] diff --git a/office/.config/aerc/binds.conf b/office/.config/aerc/binds.conf index 9400cbd..a33819f 100644 --- a/office/.config/aerc/binds.conf +++ b/office/.config/aerc/binds.conf @@ -150,8 +150,8 @@ a = :archive flat # archive message A = :unmark -a:mark -T:archive flat # archive thread M = :menu -d :move # move mail - = :copy-link - = :open-link + = :copy-link + = :open-link m = :compose f = :forward From 38b02f5680a8046d4da45f41cf899381c1eb3f92 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 20 Sep 2025 23:15:33 +0200 Subject: [PATCH 5/9] 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. --- .dotter/global.toml | 1 + .dotter/sample.toml | 1 + office/.config/aerc/Personal.qmap | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 office/.config/aerc/Personal.qmap diff --git a/.dotter/global.toml b/.dotter/global.toml index 5fde0a6..ac857f0 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -60,6 +60,7 @@ pass = "~" "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/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" } diff --git a/.dotter/sample.toml b/.dotter/sample.toml index b834dd2..1230790 100644 --- a/.dotter/sample.toml +++ b/.dotter/sample.toml @@ -26,3 +26,4 @@ mail_notmuch_other_email = "" mail_aerc_from_email = "" mail_aerc_aliases_email = "" +mail_aerc_notmuch_label_map = ["list = tag:list and not tag:trash"] diff --git a/office/.config/aerc/Personal.qmap b/office/.config/aerc/Personal.qmap new file mode 100644 index 0000000..0053a53 --- /dev/null +++ b/office/.config/aerc/Personal.qmap @@ -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}} From c130b2a6b6fd7bb65838b933cb6b3ba7b34582f5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 17 Sep 2025 16:48:43 +0200 Subject: [PATCH 6/9] notmuch: Update hooks --- .dotter/global.toml | 1 + .dotter/sample.toml | 3 ++ office/.config/aerc/aerc.conf | 6 +++ office/.config/notmuch/config | 4 +- office/.config/notmuch/default/hooks/post-new | 12 ++++++ office/.config/notmuch/default/hooks/pre-new | 39 +++++++++++++++++++ 6 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 office/.config/notmuch/default/hooks/post-new create mode 100755 office/.config/notmuch/default/hooks/pre-new diff --git a/.dotter/global.toml b/.dotter/global.toml index ac857f0..e695c82 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -61,6 +61,7 @@ pass = "~" "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" } diff --git a/.dotter/sample.toml b/.dotter/sample.toml index 1230790..869f496 100644 --- a/.dotter/sample.toml +++ b/.dotter/sample.toml @@ -23,6 +23,9 @@ 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 = "" diff --git a/office/.config/aerc/aerc.conf b/office/.config/aerc/aerc.conf index 3f12fe9..0cc2fce 100644 --- a/office/.config/aerc/aerc.conf +++ b/office/.config/aerc/aerc.conf @@ -97,5 +97,11 @@ application/vnd.oasis.opendocument.text = pandoc -f odt -t plain .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] diff --git a/office/.config/notmuch/config b/office/.config/notmuch/config index fe92f8b..860e3c0 100644 --- a/office/.config/notmuch/config +++ b/office/.config/notmuch/config @@ -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 # diff --git a/office/.config/notmuch/default/hooks/post-new b/office/.config/notmuch/default/hooks/post-new new file mode 100755 index 0000000..656e744 --- /dev/null +++ b/office/.config/notmuch/default/hooks/post-new @@ -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 diff --git a/office/.config/notmuch/default/hooks/pre-new b/office/.config/notmuch/default/hooks/pre-new new file mode 100755 index 0000000..5af5606 --- /dev/null +++ b/office/.config/notmuch/default/hooks/pre-new @@ -0,0 +1,39 @@ +#!/usr/bin/env sh +# Little script which moves some tags to specific folders. +# +# These 'folder-tags' (e.g. trash, archive, inbox) are transient tags +# which then get removed when the file is in the correct folder. +# +# So later when trying to find the emails always use the 'folder:< >' +# notmuch search, not the 'tag:< >' search - as the tag only signals that +# an e-mail is currently still in the 'wrong' folder and a move action +# is necessary. + +MAIL_DIR="$MAIL_PATH" +MAIL_DIR="${XDG_DOCUMENTS_DIR:-$HOME/documents}/mail" + +# all folders: -archive -drafts +inbox -jobs -junk -receipts -sent -trash + +# idea: archive, inbox, trash, sent -> transient tags +# if anything is tagged, it should be moved into the folder and the tag removed. +# Transient tags describe the _type_ of a message (essentially its importance to me) +# +# jobs, junk, receipts -> describe _what_ a message is (topics etc) +# -> stable tags, which stay on a message + +move_and_untag() { + tag_to_remove=$1 # e.g. trash + folder=$2 # e.g. Trash + filter="tag:$tag_to_remove not folder:$folder" + id_list=$(notmuch search --output=messages --format=text "$filter") + # echo "Moving $(notmuch count "$filter") messages to $folder." # TODO: optional loud mode? + notmuch search --output=files --format=text0 "$filter" | xargs -0 --no-run-if-empty mv -t "$MAIL_DIR/$folder/new/" + if [ "$id_list" != "" ]; then + echo "$id_list" | sed -e "s/^/-$tag_to_remove -- /" | notmuch tag --batch + fi +} + +move_and_untag trash Trash +move_and_untag inbox Inbox +move_and_untag archive Archive +move_and_untag sent Sent From 4328cbba391300cd32a8118e8d348f8b678ccaf0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Sep 2025 10:45:53 +0200 Subject: [PATCH 7/9] notmuch: Remove move-and-untag pre hook --- office/.config/notmuch/default/hooks/pre-new | 39 -------------------- 1 file changed, 39 deletions(-) delete mode 100755 office/.config/notmuch/default/hooks/pre-new diff --git a/office/.config/notmuch/default/hooks/pre-new b/office/.config/notmuch/default/hooks/pre-new deleted file mode 100755 index 5af5606..0000000 --- a/office/.config/notmuch/default/hooks/pre-new +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env sh -# Little script which moves some tags to specific folders. -# -# These 'folder-tags' (e.g. trash, archive, inbox) are transient tags -# which then get removed when the file is in the correct folder. -# -# So later when trying to find the emails always use the 'folder:< >' -# notmuch search, not the 'tag:< >' search - as the tag only signals that -# an e-mail is currently still in the 'wrong' folder and a move action -# is necessary. - -MAIL_DIR="$MAIL_PATH" -MAIL_DIR="${XDG_DOCUMENTS_DIR:-$HOME/documents}/mail" - -# all folders: -archive -drafts +inbox -jobs -junk -receipts -sent -trash - -# idea: archive, inbox, trash, sent -> transient tags -# if anything is tagged, it should be moved into the folder and the tag removed. -# Transient tags describe the _type_ of a message (essentially its importance to me) -# -# jobs, junk, receipts -> describe _what_ a message is (topics etc) -# -> stable tags, which stay on a message - -move_and_untag() { - tag_to_remove=$1 # e.g. trash - folder=$2 # e.g. Trash - filter="tag:$tag_to_remove not folder:$folder" - id_list=$(notmuch search --output=messages --format=text "$filter") - # echo "Moving $(notmuch count "$filter") messages to $folder." # TODO: optional loud mode? - notmuch search --output=files --format=text0 "$filter" | xargs -0 --no-run-if-empty mv -t "$MAIL_DIR/$folder/new/" - if [ "$id_list" != "" ]; then - echo "$id_list" | sed -e "s/^/-$tag_to_remove -- /" | notmuch tag --batch - fi -} - -move_and_untag trash Trash -move_and_untag inbox Inbox -move_and_untag archive Archive -move_and_untag sent Sent From e0a8db11946b88d5aba3d00910adaf9d4409e0a5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 21 Sep 2025 15:59:09 +0200 Subject: [PATCH 8/9] 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. --- office/.local/bin/aerc-in-terminal | 3 +++ office/.local/share/applications/aerc.desktop | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 office/.local/bin/aerc-in-terminal create mode 100644 office/.local/share/applications/aerc.desktop diff --git a/office/.local/bin/aerc-in-terminal b/office/.local/bin/aerc-in-terminal new file mode 100755 index 0000000..8a714bd --- /dev/null +++ b/office/.local/bin/aerc-in-terminal @@ -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 "$@" diff --git a/office/.local/share/applications/aerc.desktop b/office/.local/share/applications/aerc.desktop new file mode 100644 index 0000000..2921b65 --- /dev/null +++ b/office/.local/share/applications/aerc.desktop @@ -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 From e84584fb0d7b65c29c4ba1040334bf5f2e10da67 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Sep 2025 20:19:16 +0200 Subject: [PATCH 9/9] wezterm: Remove emoji picker key bind I use my own 'bemoji' picker everywhere, including wezterm. --- terminal/.config/wezterm/maps.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/terminal/.config/wezterm/maps.lua b/terminal/.config/wezterm/maps.lua index 12e7848..57d0740 100644 --- a/terminal/.config/wezterm/maps.lua +++ b/terminal/.config/wezterm/maps.lua @@ -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) },