From e57cfb77fc7e30ff55d951fd2438f0af14a4989a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 21 Sep 2025 10:43:49 +0200 Subject: [PATCH 01/16] dotter: Add default variable template helper --- .dotter/global.toml | 1 + .dotter/helpers/var_with_default.rhai | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .dotter/helpers/var_with_default.rhai diff --git a/.dotter/global.toml b/.dotter/global.toml index 69d2ab9..f85bfe2 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -4,6 +4,7 @@ default_target_type = "symbolic" [helpers] +with_default = ".dotter/helpers/var_with_default.rhai" # BASE: A base system. Sets up a nice xdg (zsh) shell environment, utility scripts and # a development environment based on git and nvim. diff --git a/.dotter/helpers/var_with_default.rhai b/.dotter/helpers/var_with_default.rhai new file mode 100644 index 0000000..1d4858b --- /dev/null +++ b/.dotter/helpers/var_with_default.rhai @@ -0,0 +1,12 @@ +// tests the type of variable passed in +// if 'no' type (does not exist or cant be parsed) +// we return the second, 'default' variable + +fn choose(a, b) { + if type_of(a) != "()" { + return a; + } + return b; +} + +choose(params[0], params[1]) From 6086f470230af3ab8b06c239b3c38f758b5a6a77 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 21 Sep 2025 11:03:14 +0200 Subject: [PATCH 02/16] sh: Use dotter default var helper for credentials --- sh/.config/sh/env.d/llm-api.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sh/.config/sh/env.d/llm-api.sh b/sh/.config/sh/env.d/llm-api.sh index 63f8784..2a61a34 100644 --- a/sh/.config/sh/env.d/llm-api.sh +++ b/sh/.config/sh/env.d/llm-api.sh @@ -3,15 +3,7 @@ # # Received from dotter variables -{{#if cred_llm_groq_api_key}} -export GROQ_API_KEY="{{cred_llm_groq_api_key}}" -{{/if}} -{{#if cred_llm_groq_api_key}} -export GH_COPILOT_TOKEN="{{cred_llm_gh_copilot_token}}" -{{/if}} -{{#if cred_llm_groq_api_key}} -export ANTHROPIC_API_KEY="{{cred_llm_anthropic_api_key}}" -{{/if}} -{{#if cred_llm_groq_api_key}} -export GEMINI_API_KEY="{{cred_llm_gemini_api_key}}" -{{/if}} +export GROQ_API_KEY="{{with_default cred_llm_groq_api_key ''}}" +export GH_COPILOT_TOKEN="{{with_default cred_llm_gh_copilot_token ''}}" +export ANTHROPIC_API_KEY="{{with_default cred_llm_anthropic_api_key ''}}" +export GEMINI_API_KEY="{{with_default cred_llm_gemini_api_key ''}}" From c2e64a17e0a5b48196979f688a948d62388e48d8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 21 Sep 2025 12:39:47 +0200 Subject: [PATCH 03/16] mako: Include color configuration Include the color config for mako from ~/.local/state/mako/style instead of hardcoding it or templating it into the config file. This means we have to ensure the directory and file exist before running mako which we do with an `env.d` startup script. --- .dotter/global.toml | 3 --- desktop/.config/flavours/config.toml | 8 ++------ desktop/.config/mako/config | 8 +++----- desktop/.config/sh/env.d/mako-create-style-dir.sh | 5 +++++ 4 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 desktop/.config/sh/env.d/mako-create-style-dir.sh diff --git a/.dotter/global.toml b/.dotter/global.toml index f85bfe2..f39f98d 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -93,9 +93,6 @@ writing = "~" depends = ["linux", "desktop", "multimedia", "qutebrowser"] [desktop.files] -"desktop/.config/flavours/templates" = { target = "~/.config/flavours/templates", type = "symbolic" } -"desktop/.config/waybar/config" = { target = "~/.config/waybar/config", type = "symbolic" } -"desktop/.config/mako/config" = { target = "~/.config/mako/config", type = "template", prepend = "# TEMPLATED BY DOTTER\n" } "desktop/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } desktop = "~" diff --git a/desktop/.config/flavours/config.toml b/desktop/.config/flavours/config.toml index 517afc6..1780d13 100644 --- a/desktop/.config/flavours/config.toml +++ b/desktop/.config/flavours/config.toml @@ -73,13 +73,9 @@ start = "/* Start flavours */" end = "/* End flavours */" [[items]] -# MAKO DOES NOT SUPPORT INCLUDES YET template = "mako" -file = "~/.config/mako/config" -light = false -rewrite = false -start = "# Start flavours" -end = "# End flavours" +file = "~/.local/state/mako/style" +rewrite = true hook = "killall mako" [[items]] diff --git a/desktop/.config/mako/config b/desktop/.config/mako/config index 1b053df..0b23b51 100644 --- a/desktop/.config/mako/config +++ b/desktop/.config/mako/config @@ -9,11 +9,9 @@ default-timeout=5000 ignore-timeout=1 font=monospace 14 -# Intentionally left empty, automatically filled by flavours -# on switching theme. -# Start flavours - -# End flavours +# this requires the file to exist +# or mako will not start +include=~/.local/state/mako/style [urgency=critical] #on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga diff --git a/desktop/.config/sh/env.d/mako-create-style-dir.sh b/desktop/.config/sh/env.d/mako-create-style-dir.sh new file mode 100644 index 0000000..2c1e6e7 --- /dev/null +++ b/desktop/.config/sh/env.d/mako-create-style-dir.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +# Ensure the directory and file for mako style exists or it errors out on startup + +[ -e "${XDG_STATE_HOME:-$HOME/.local/state}/mako" ] || mkdir -p "${XDG_STATE_HOME:-$HOME/.local/state}/mako" +[ -f "${XDG_STATE_HOME:-$HOME/.local/state}/mako/style" ] || touch "${XDG_STATE_HOME:-$HOME/.local/state}/mako/style" From 1c95446ce07df73d604b263283fbc314253d7ff6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 21 Sep 2025 13:08:18 +0200 Subject: [PATCH 04/16] dotter: Remove unnecessary explicit symbolic links --- .dotter/global.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.dotter/global.toml b/.dotter/global.toml index f39f98d..edcb95d 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -29,8 +29,6 @@ sh = "~" vcs = "~" [nvim.files] -"nvim/.config/nvim/spell/de.utf-8.add.spl" = { target = "~/.config/nvim/spell/de.utf-8.add.spl", type = "symbolic" } -"nvim/.config/nvim/spell/en.utf-8.add.spl" = { target = "~/.config/nvim/spell/en.utf-8.add.spl", type = "symbolic" } nvim = "~" [scripts.files] @@ -58,7 +56,6 @@ pass = "~" [office.files] "office/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } -"office/.config/glow/email.json" = { target = "~/.config/glow/email.json", type = "symbolic" } "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" } @@ -98,10 +95,6 @@ desktop = "~" [multimedia.files] "multimedia/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } -"multimedia/.config/mpv/scripts" = { target = "~/.config/mpv/scripts", type = "symbolic" } -"multimedia/.config/ncmpcpp/config" = { target = "~/.config/ncmpcpp/config", type = "symbolic" } -"multimedia/.config/mpv/fonts/uosc_icons.otf" = { target = "~/.config/mpv/fonts/uosc_icons.otf", type = "symbolic" } -"multimedia/.config/mpv/fonts/uosc_textures.ttf" = { target = "~/.config/mpv/fonts/uosc_textures.ttf", type = "symbolic" } "multimedia/.config/vimiv/styles/base16" = { target = "~/.config/vimiv/styles/base16", type = "template" } multimedia = "~" From b52d58dd58095d35144a348141eb756695569b5b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 21 Sep 2025 15:41:18 +0200 Subject: [PATCH 05/16] services: Kill waybar processes before starting service --- services/sv/waybar/run | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/sv/waybar/run b/services/sv/waybar/run index 31b6db6..3e61f01 100755 --- a/services/sv/waybar/run +++ b/services/sv/waybar/run @@ -1,6 +1,9 @@ #!/bin/sh +#shellcheck disable=SC1091 [ -r ./conf ] && . ./conf +pgrep -x waybar && pkill -x waybar + exec 2>&1 exec chpst -e "$TURNSTILE_ENV_DIR" waybar From 87bc21ef19f8bea26dfab8fd1f80d008f690e789 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 17 Sep 2025 16:48:43 +0200 Subject: [PATCH 06/16] neomutt: Add display and bind changes --- office/.config/neomutt/colors | 4 +- office/.config/neomutt/keys/bind | 92 ++++++++++++-------------------- office/.config/neomutt/mailcap | 11 ++-- office/.config/neomutt/neomuttrc | 64 ++++++++++++++++++++++ 4 files changed, 109 insertions(+), 62 deletions(-) diff --git a/office/.config/neomutt/colors b/office/.config/neomutt/colors index bd7d123..9d0fd4c 100644 --- a/office/.config/neomutt/colors +++ b/office/.config/neomutt/colors @@ -48,13 +48,13 @@ color progress black cyan # Formatting ---------------------------------------------------------------------- set date_format = "%a %d %h %H:%M" -set index_format=" %zc %zs %zt | %-35.35L %?X?& ? %M %-30.100s %> %?Y?%Y ? %(!%a %d %h %H:%M) " +set index_format=" %zc %zs %zt | %-20.20L %?X?& ? %M %-30.100s %> %?Y?%Y ? %(!%a %d %h %H:%M) %B" set pager_format="%n %T %s%*  %{!%d %b · %H:%M} %?X? %X?%P" set status_format = " %D %?u? %u ?%?R? %R ?%?d? %d ?%?t? %t ?%?F? %F ?%?p? %p? \n \n" set compose_format="-- NeoMutt: Compose [Approx. msg size: %l Atts: %a]%>-" # set vfolder_format = "%N %?n?%3n& ? %8m  · %f" set attach_format = "%u%D  %T %-75.20d %T  %5s %m/%M" -set sidebar_format = '%B%%* %%S' +set sidebar_format = '%D%%* %%S' index-format-hook attachment_info '=B text/calendar ~X 1' ' ' index-format-hook attachment_info '=B text/calendar' " " index-format-hook attachment_info '~X 1' " " diff --git a/office/.config/neomutt/keys/bind b/office/.config/neomutt/keys/bind index 29f5712..a4ffd65 100644 --- a/office/.config/neomutt/keys/bind +++ b/office/.config/neomutt/keys/bind @@ -42,27 +42,31 @@ macro index K ":set resolve=no:set resolv macro index t ":set resolve=no:set resolve=yes" "tag current thread" macro index T ":set resolve=no:set resolve=yes" "tag current entry" -# flagging -bind index,pager ,F set-flag -bind index,pager ,fc clear-flag -bind index,pager ,\cf clear-flag -bind index,pager ,ff flag-message -bind index ,fs toggle-new # can't toggle new WHILE reading a msg -macro index ,S "T~UN." "mark all messages as read" -bind index,pager ,fl edit-label # set X-Label Header +# # flagging +# bind index,pager ,F modify-labels +# bind index,pager ,fc clear-flag +# bind index,pager ,\cf clear-flag +# bind index,pager ,ff flag-message +# bind index ,fs toggle-new # can't toggle new WHILE reading a msg +# macro index ,S "T~UN." "mark all messages as read" +# bind index,pager ,fl edit-label # set X-Label Header +# # Saner copy/move dialogs +# macro index,pager ,c "?" "copy a message to a mailbox" +# macro index,pager ,m "?" "move thread to a mailbox" +# macro index,pager ,M "?" "move a message to a mailbox" # sorting bind index s sort-mailbox bind index S sort-reverse # threads -bind index l display-message -bind index display-message +macro index l "" "display message" +macro index "" "display message" bind index h collapse-thread bind index collapse-thread # TODO: Remove in favor of learning za? bind pager,index + link-threads bind pager,index - break-thread -bind pager,index gt next-thread +bind pager,index gt next-thread # TODO: overwritten by go to trash bind pager,index gT previous-thread bind pager,index za collapse-thread bind pager,index zA collapse-all @@ -76,13 +80,8 @@ bind index,pager dt delete-subthread bind index,pager u undelete-thread bind index,pager U undelete-message # TODO: Figure out -macro index D ";:set resolve=no!=Archiveecho 'Message deleted':set resolve=yes" "Quick Delete" -macro index A ";:set resolve=no!=Archiveecho 'Message archived':set resolve=yes" "Quick Archive" - -# Saner copy/move dialogs -macro index,pager ,c "?" "copy a message to a mailbox" -macro index,pager ,m "?" "move thread to a mailbox" -macro index,pager ,M "?" "move a message to a mailbox" +# macro index D ";:set resolve=no!=Archiveecho 'Message deleted':set resolve=yes" "Quick Delete" +# macro index A ";:set resolve=no!=Archiveecho 'Message archived':set resolve=yes" "Quick Archive" # search navigation bind generic,index,attach,browser,pager n search-next # next result @@ -176,16 +175,28 @@ bind compose gr group-related bind compose gl group-multilingual bind compose gu ungroup-attachment +# manage attachments macro attach s 'source "neomutt-filer saveto ~/downloads"|' "Save attachment to dir" bind attach view-mailcap bind attach l view-mailcap -# questions -# https://github.com/ceuk/mutt_dotfiles/blob/master/.config/mutt/keys/binds.muttrc -# macro index \# "\n" "Mark as Complete" -# macro index "\n\n" -# macro index x "all\n" "show all messages (undo limit)" -# macro index \ci "~F\n" "Limit by flagged" +# mailbox navigation +macro index,pager gi "Inbox" "go to inbox" +macro index,pager gs "Sent" "go to sent" +macro index,pager gd "Drafts" "go to drafts" +macro index,pager gt "Trash" "go to trash" +macro index,pager ga "Archive" "go to archive" +macro index,pager gr "Receipts" "go to receipts" +macro index,pager gj "Jobs" "go to jobs" + +#### Misc functions and macros + +# Refresh far imap email +macro index,pager O "export MBSYNC_PRE=true; neomutt-syncmail" "refresh all e-mail" + +# Send mail to taskwarrior +macro index,pager ,t "neomutt-2task -c -d -t" "add mail to taskwarrior" +macro index,pager ,T "neomutt-2task -c" "quickadd mail to taskwarrior" # Write (djot-flavored) markdown and instantly transform it into a TXT/HTML result # HTML-enabled email readers display that and others can still enjoy a txt representation @@ -199,38 +210,5 @@ macro compose ,m \ " \ "Convert markdown to HTML5 and plaintext alternative content types" -# -# -# # mailbox navigation -macro index,pager gi "=Inbox" "go to inbox" -# macro index,pager gs "=Sent" "go to sent" -# macro index,pager gd "=Drafts" "go to drafts" -# macro index,pager gt "=Trash" "go to trash" -# macro index,pager ga "=Archive" "go to archive" -# macro index,pager gj "=Junk" "go to junk" -# # pager navigation -# bind pager,attach h exit -# bind pager l view-attachments -# bind pager k previous-line -# bind pager j next-line -# bind pager gg top -# bind pager G bottom -# -# # markdown to html for composition -# # TODO: Check if this is working - F is a spelling mistake no? -# macro compose ,m "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=UTF-8\n" "Convert from MD to HTML" -# -# -# # since we unbound the original g -# bind index,pager r noop # to avoid accidentally sending replies -# bind index,pager rr group-reply -# bind index,pager ro reply # # open urls found in the e-mail # macro index,pager \CU " unset pipe_decodeextract_url | fzf | clip" "get URLs" -# -# # Refresh far imap email -# macro index O "export MBSYNC_PRE=true; neomutt-syncmail" "refresh all e-mail" -# -# # Send mail to taskwarrior -# macro index,pager ,T "neomutt-2task -c -d -t" "add mail as task to taskwarrior with custom description and tags" -# macro index,pager ,t "neomutt-2task -c" "add mail as task to taskwarrior" diff --git a/office/.config/neomutt/mailcap b/office/.config/neomutt/mailcap index 1f634ff..123dda9 100644 --- a/office/.config/neomutt/mailcap +++ b/office/.config/neomutt/mailcap @@ -19,10 +19,15 @@ video/*; setsid mpv --quiet %s &; copiousoutput # open spreadsheets in sc-im application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; sc-im %s; needsterminal -# open anything else externally -application/pdf; open %s; +# documents +application/pdf; pdftotext -layout %s -; copiousoutput; print=open %s +application/msword; pandoc --from docx --to plain %s; copiousoutput +application/vnd.openxmlformats-officedocument.wordprocessingml.document; pandoc --from odt --to plain %s; copiousoutput +application/rtf; pandoc --from rtf --to plain %s; copiousoutput + -application/*; mkdir -p /tmp/mutt \; cp %s /tmp/mutt \; open /tmp/mutt/$(basename %s) & application/pgp-encrypted; gpg -d '%s'; copiousoutput; application/pgp-keys; gpg --import '%s'; copiousoutput; +# open anything else externally +application/*; mkdir -p /tmp/mutt \; cp %s /tmp/mutt \; open /tmp/mutt/$(basename %s) & diff --git a/office/.config/neomutt/neomuttrc b/office/.config/neomutt/neomuttrc index e768713..202bfc0 100644 --- a/office/.config/neomutt/neomuttrc +++ b/office/.config/neomutt/neomuttrc @@ -5,3 +5,67 @@ source keys/unbind source keys/bind source account + +################## notmuch settings +# index notmuch on start and exit +startup-hook "`command -v notmuch && notmuch new 2>/dev/null`" +shutdown-hook "`command -v notmuch && notmuch new 2>/dev/null`" +# whenever changing directory fetch changes +folder-hook notmuch:// "push 'notmuch new >/dev/null'" + +set nm_query_type = "threads" +set nm_exclude_tags = "spam" +set nm_record = yes +set nm_record_tags = "-inbox,archive" +virtual-mailboxes "Inbox" "notmuch://?query=folder:Inbox" \ + "Unread" "notmuch://?query=tag:unread" \ + "Archive" "notmuch://?query=folder:Archive" \ + "Drafts" "notmuch://?query=folder:Drafts" \ + "Sent" "notmuch://?query=folder:Sent" \ + "Jobs" "notmuch://Jobs?query=folder:Jobs" \ + "Receipts" "notmuch://?query=folder:Receipts" \ + "Junk" "notmuch://?query=folder:Junk" \ + "github" "notmuch://?query=tag:github" \ + "bemoji" "notmuch://?query=tag:bemoji"\ + "All" "notmuch://?query=*"\ + "Trash" "notmuch://?query=folder:Trash" \ + +push 'Inbox' + +virtual-mailboxes "date/" "notmuch://?query=date:today.."\ + " this week" "notmuch://?query=date:week.."\ + " this month" "notmuch://?query=date:month.." + +virtual-mailboxes "attach/" "notmuch://?query=attachment:\.%20not%20attachment:\.pdf"\ + " with PDF" "notmuch://?query=attachment:\.pdf"\ + " with JPG" "notmuch://?query=attachment:\.jpg%20or%20attachment:\.png" + +# bind index,pager S modify-labels # allow +adding -removing !toggling any notmuch tags +# macro index,pager f "+flagged" "Toggle flagged tag" +# +# macro index,pager ,ff "!flaggednotmuch new" "toggle flag" +macro index,pager ,ff "!flagged" "toggle flag" +macro index,pager ,fi "+inbox" "send to inbox" +macro index,pager R " '+trashnotmuch new'" "send to trash" + + +bind index,pager w modify-labels +# macro index A "+archive -unread -inbox" +# macro index I "-inbox -unread" +# macro index S "" + +tag-transforms "unread" "U" +tag-formats "inbox" "GI" \ + "flagged" "GF" \ + "unread" "GU" \ + "test" "Gt" \ + +color index_tags red black +set index_format="%zc %zs %zt | %-20.20L %?X?& ? %M %-30.100s %* %?GF?%GF ? %(!%a %d %h %H:%M)" + +# conditional dates, showing "09:48" for today's msg, "Mon 27 Aug" for this year's msg, +# "22 Dec '24" for previous years +# set index_format="%-30.100s %* %<[y?%<[d?%[%H:%M]&%[%a %d %h]>&%[%d %h \'%y]>" + + +# - [ ] show 'Inbox' etc in index IF we are in query results From 9dcda2a53de8f492df6dbf28fb1d5d4459d47f3f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Sep 2025 10:17:32 +0200 Subject: [PATCH 07/16] dotter: Add sample file containing all private variables This helps to show what is 'hidden' in the public repository and also shows me at a glance all the dotter-supplied variables to keep an overview of where we inject stuff. --- .dotter/sample.toml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .dotter/sample.toml diff --git a/.dotter/sample.toml b/.dotter/sample.toml new file mode 100644 index 0000000..20b3e15 --- /dev/null +++ b/.dotter/sample.toml @@ -0,0 +1,25 @@ +includes = [] +packages = ["workstation"] + +[files] + +[variables] + +multimedia_beets_musicbrainz_user = "" +multimedia_beets_musicbrainz_pass = "" +multimedia_mopidy_subidy_url = "" +multimedia_mopidy_subidy_user = "" +multimedia_mopidy_subidy_pass = "" + +cred_llm_groq_api_key = "" +cred_llm_gh_copilot_token = "" +cred_llm_anthropic_api_key = "" +cred_llm_gemini_api_key = "" + +mail_personal_host = "" +mail_personal_username_cmd = "" +mail_personal_password_cmd = "" + +mail_notmuch_name = "" +mail_notmuch_primary_email = "" +mail_notmuch_other_email = "" From 8fdffef644ed42c92dc1df25f5a40c3140f15f56 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Sep 2025 09:58:29 +0200 Subject: [PATCH 08/16] 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 09/16] 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 10/16] 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 11/16] 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 12/16] 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 13/16] 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 14/16] 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 15/16] 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 16/16] 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) },