From 1d8aab411b6f0316176b2ff26a2abfb703b62453 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 6 Jul 2022 17:37:10 +0200 Subject: update --- .config/mutt/defaults.muttrc | 4 ++-- .local/bin/mutt_md2html.sh | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.config/mutt/defaults.muttrc b/.config/mutt/defaults.muttrc index 99f58fe..f4071b5 100644 --- a/.config/mutt/defaults.muttrc +++ b/.config/mutt/defaults.muttrc @@ -68,7 +68,7 @@ bind editor complete-query #set crypt_autosign = yes #set crypt_opportunistic_encrypt = yes #set pgp_self_encrypt = yes -set pgp_default_key = 'bousset.rudy@gmail.com' +set pgp_default_key = '0x0EAB41FC2D9F762A' macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook -C $XDG_CONFIG_HOME/abook/abookrc --datafile $XDG_DATA_HOME/abook/addressbook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" macro index \Cr "T~UN." "mark all messages as read" @@ -77,7 +77,7 @@ macro index \Cf "unset wait_keyprintf 'Enter macro index A "all\n" "show all messages (undo limit)" macro compose Y "\ mutt_md2html.sh\ -source /tmp/neomutt-commands" +source /tmp/neomutt_commands" # Sidebar mappings set sidebar_visible = yes diff --git a/.local/bin/mutt_md2html.sh b/.local/bin/mutt_md2html.sh index a920093..9915f96 100755 --- a/.local/bin/mutt_md2html.sh +++ b/.local/bin/mutt_md2html.sh @@ -1,6 +1,6 @@ #!/bin/sh -commands_file="/tmp/neomutt-commands" +commands_file="/tmp/neomutt_commands" markdown_file="/tmp/neomutt-$(hostname -s)-$(id -u)-$(date +%s)" html_file="/tmp/neomutt-$(hostname -s)-$(id -u)-$(date +%s).html" @@ -17,7 +17,14 @@ if [ "$img_count" -gt 0 ]; then real_file=$(echo "$file" | sed "s#~#$HOME#g") id="cid:$(md5 "$real_file" | rev | cut -d ' ' -f 1 | rev)" sed -i '.orig' "s#$file#$id#g" "$markdown_file" + { + printf '"%s"' "$real_file" + printf '' + printf '^u"%s"' "$id" + printf '' + } >>"$commands_file" done + printf '' >>"$commands_file" printf '"%s"' \ "$markdown_file" >>"$commands_file" fi @@ -32,18 +39,11 @@ pandoc -f markdown -t html5 --standalone "$markdown_file" >"$html_file" printf '' } >>"$commands_file" -if [ "$img_count" -gt 0 ]; then - grep -Eo '!\[[^]]*\]\([^)]+' "${markdown_file}.orig" | cut -d '(' -f 2 | - grep -Ev '^(cid:|https?://)' | - while read -r file; do - real_file=$(echo "$file" | sed "s#~#$HOME#g") - id="cid:$(md5 "$real_file" | rev | cut -d ' ' -f 1 | rev)" - { - printf '"%s"' "$real_file" - printf '' - printf '^u"%s"' "$id" - printf '' - } >>"$commands_file" - printf '' >>"$commands_file" - done -fi +# if [ "$img_count" -gt 0 ]; then +# grep -Eo '!\[[^]]*\]\([^)]+' "${markdown_file}.orig" | cut -d '(' -f 2 | +# grep -Ev '^(cid:|https?://)' | +# while read -r file; do +# real_file=$(echo "$file" | sed "s#~#$HOME#g") +# id="cid:$(md5 "$real_file" | rev | cut -d ' ' -f 1 | rev)" +# done +# fi -- cgit v1.2.3