From 5da1757eb9bcee6a739f0ca3ce969eb93f90f392 Mon Sep 17 00:00:00 2001 From: tristan Date: Thu, 20 Apr 2023 18:50:35 +0100 Subject: [PATCH] aerc --- system/global/home.nix | 264 +++++++++++++++++++++++++++++++++++++++++ system/zenix/home.nix | 10 +- 2 files changed, 271 insertions(+), 3 deletions(-) diff --git a/system/global/home.nix b/system/global/home.nix index 09aaff4..d986fe4 100644 --- a/system/global/home.nix +++ b/system/global/home.nix @@ -406,6 +406,40 @@ in programs.lf.package = lf-sixel; programs.lf.keybindings = { D = "trash"; + "" = ":rename"; + "" = "open-with"; + }; + programs.lf.commands = { + trash = "%${pkgs.trash-cli}/bin/trash-put \"$fx\""; + open-with = ''''${{ + set -f + ${pkgs.ranger}/bin/rifle -l $fx + read -p "Open with: " method + ${pkgs.ranger}/bin/rifle -p $method $fx + }}''; + bulk-rename = ''''${{ + old="$(mktemp)" + new="$(mktemp)" + if [ -n "$fs" ]; then + fs="$(basename -a $fs)" + else + fs="$(ls)" + fi + printf '%s\n' "$fs" >"$old" + printf '%s\n' "$fs" >"$new" + $EDITOR "$new" + [ "$(wc -l < "$new")" -ne "$(wc -l < "$old")" ] && exit + paste "$old" "$new" | while IFS= read -r names; do + src="$(printf '%s' "$names" | cut -f1)" + dst="$(printf '%s' "$names" | cut -f2)" + if [ "$src" = "$dst" ] || [ -e "$dst" ]; then + continue + fi + mv -- "$src" "$dst" + done + rm -- "$old" "$new" + lf -remote "send $id unselect" + }}''; }; programs.lf.previewer.source = pkgs.writeShellScript "preview" '' image () { @@ -507,4 +541,234 @@ in ]; }; + programs.neomutt.extraConfig = '' + +# Default index colors: +color index yellow default '.*' +color index_author red default '.*' +color index_number blue default +color index_subject cyan default '.*' + +# New mail is boldened: +color index brightyellow black "~N" +color index_author brightred black "~N" +color index_subject brightcyan black "~N" + +# Tagged mail is highlighted: +color index brightyellow blue "~T" +color index_author brightred blue "~T" +color index_subject brightcyan blue "~T" + +# Other colors and aesthetic settings: +mono bold bold +mono underline underline +mono indicator reverse +mono error bold +color normal default default +color indicator brightblack white +color sidebar_highlight red default +color sidebar_divider brightblack black +color sidebar_flagged red black +color sidebar_new green black +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color status brightyellow black +color hdrdefault brightgreen default +color quoted green default +color quoted1 blue default +color quoted2 cyan default +color quoted3 yellow default +color quoted4 red default +color quoted5 brightred default +color signature brightgreen default +color bold black default +color underline black default +color normal default default + +# Regex highlighting: +color header blue default ".*" +color header brightmagenta default "^(From)" +color header brightcyan default "^(Subject)" +color header brightwhite default "^(CC|BCC)" +color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses +color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL +color body green default "\`[^\`]*\`" # Green text between ` and ` +color body brightblue default "^# \.*" # Headings as bold blue +color body brightcyan default "^## \.*" # Subheadings as bold cyan +color body brightgreen default "^### \.*" # Subsubheadings as bold green +color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" +color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" + ''; + + programs.aerc.extraBinds = '' + # 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 + = :prev-tab + = :next-tab + = :term + + [messages] + Q = :quit + + T = :toggle-threads + + j = :next + = :next + = :next 50% + = :next 100% + = :next -s 100% + + k = :prev + = :prev + = :prev 50% + = :prev + = :prev -s 100% + gg = :select 0 + G = :select -1 + + J = :next-folder + K = :prev-folder + + v = :mark -t + V = :mark -v + + f = :flag + F = :unflag + + t = :toggle-threads + + = :view + D = :delete + + C = :compose + + Rr = :reply + Rq = :reply -q + rr = :reply -a + rq = :reply -aq + rt = :unflag:reply -a -Tthanks + Rt = :unflag:reply -qa -Tquoted_thanks + + a = :mv Archive + + c = :cf + $ = :term + ! = :term + | = :pipe + + ga = :flag:pipe -mb git am -3 + gp = :term git push + gl = :term git log + + / = :search + \ = :filter + n = :next-result + N = :prev-result + + [view] + / = :toggle-key-passthrough/ + q = :close + | = :pipe -m + S = :save + H = :toggle-headers + D = :delete + = :prev-part + = :next-part + J = :next + K = :prev + + f = :forward + Rr = :reply + Rq = :reply -q + rr = :reply -a + rq = :reply -aq + rt = :reply -Tthanks + + ga = :pipe -b git am -3 + gp = :term git push + gl = :term git log + + [view::passthrough] + $noinherit = true + $ex = + = :toggle-key-passthrough + + [compose] + $ex = + = :prev-field + = :next-field + = :next-field + + [compose::editor] + # Keybindings used when the embedded terminal is selected in the compose view + $noinherit = true + $ex = + = :term + = :prev-field + = :next-field + = :prev-tab + = :next-tab + + [compose::review] + # Keybindings used when reviewing a message to be sent + y = :send + n = :abort + e = :edit + a = :attach + c = :encrypt + s = :sign + V = :header -f X-Sourcehut-Patchset-Update NEEDS_REVISION + A = :header -f X-Sourcehut-Patchset-Update APPLIED + R = :header -f X-Sourcehut-Patchset-Update REJECTED + + [terminal] + $noinherit = true + $ex = + + = :term + = :prev-tab + = :next-tab + ''; + + programs.aerc.extraConfig = { + general = { + pgp-provider = "gpg"; + unsafe-accounts-conf = true; + }; + ui = { }; + viewer = { }; + filters = { + "text/plain" = "colorize"; + "text/calendar" = "calendar"; + "message/delivery-status" = "colorize"; + "message/rfc822" = "colorize"; + "image/*" = "img2sixel"; + "text/html" = "html | colorize"; + }; + + }; + } + + + + + + diff --git a/system/zenix/home.nix b/system/zenix/home.nix index b6b7034..009fc6f 100644 --- a/system/zenix/home.nix +++ b/system/zenix/home.nix @@ -13,6 +13,8 @@ musescore ansible handbrake + monero-gui + xmrig ]; services.nextcloud-client.enable = true; @@ -22,17 +24,18 @@ userName = "tristan"; userEmail = "tristan@tristans.cloud"; }; - + accounts.email.accounts."tristan@tristans.cloud" = { notmuch.enable = true; neomutt.enable = true; + aerc.enable = true; mbsync.enable = true; - mbsync.create = "maildir"; + mbsync.create = "both"; userName = "tristan@tristans.cloud"; realName = "Tristan"; address = "tristan@tristans.cloud"; primary = true; - passwordCommand = "rbw get privateemail"; + passwordCommand = "${pkgs.rbw}/bin/rbw get privateemail"; smtp = { host = "mail.privateemail.com"; port = 465; @@ -54,6 +57,7 @@ }; programs.mbsync.enable = true; services.mbsync.enable = true; + programs.aerc.enable = true; wayland.windowManager.hyprland = { extraConfig = ''