From 256c091196c6f7713f875e2a327f2c3755d5c45b Mon Sep 17 00:00:00 2001 From: Jberczel Date: Mon, 1 Nov 2021 11:52:59 -0400 Subject: Cleanup reorder account numbers action Refactors commit 85c5d01 * Keep the comment(s) when reordering account numbers in temp file. Users may accidently reorder rows or rename accounts rather than update order number. * Remove original default config from muttrc. Currently, script only removes the macro shortcuts .If you run reorder action multiple times, you'll end up sourcing multiple "default" config files. --- bin/mw | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/mw b/bin/mw index 5205a13..bcca18d 100755 --- a/bin/mw +++ b/bin/mw @@ -308,23 +308,27 @@ To change an account's password, run \`pass edit your@email.com\`. EOF } -reorder(){ +reorder() { tempfile="$(mktemp -u)" trap 'rm -f $tempfile' HUP INT QUIT TERM PWR EXIT - echo "# Carefully reorder these accounts with the desired numbers." > "$tempfile" + echo "# Carefully reorder these accounts with the desired numbers in the first column. +# DO NOT reorder rows or rename the accounts in the second column." > "$tempfile" sed -n " / i[0-9] / s?\(.* i\|' "$tempfile" + " "$muttrc" >> "$tempfile" ${EDITOR:-vim} "$tempfile" || exit 1 + sed -i -e 's/#.*//' -e '/^$/d' "$tempfile" default="$(sort -n "$tempfile" | head -n 1)" default="${default#* }" - sed -ibu "/.* i[0-9] .*.muttrc/d" "$muttrc" 2>/dev/null; rm -f "$muttrc"bu + sed -ibu " + /.* i[0-9] .*.muttrc/d + /^source.*accounts.*.muttrc/d + " "$muttrc" 2>/dev/null; rm -f "$muttrc"bu awk -v a="$accdir" -v d="$default" ' BEGIN { print "source "a"/"d".muttrc" } { print "macro index,pager i"$1" '\''source "a"/"$2".muttrc!;'\'' \"switch to "$2"\"" } ' "$tempfile" >> "$muttrc" - } while getopts "rfpPXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in -- cgit v1.2.3 From 8e81135f8bb79930ed2495b90784cacc83cbb73f Mon Sep 17 00:00:00 2001 From: Matthew McCulley Date: Sun, 7 Nov 2021 09:05:27 -0500 Subject: Checks $HOME/.confg/zsh/.zshenv for Env variables --- bin/mailsync | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/mailsync b/bin/mailsync index ca7411d..e939b78 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -23,7 +23,8 @@ pgrep mbsync >/dev/null && { echo "mbsync is already running."; exit ;} eval "$(grep -h -- \ "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \ "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \ - "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)" + "$HOME/.config/zsh/.zshenv" "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" \ + "$HOME/.pam_environment" 2>/dev/null)" export GPG_TTY="$(tty)" -- cgit v1.2.3 From 37c91057f78542e8970cf7698c0c1588153c30f2 Mon Sep 17 00:00:00 2001 From: Aisha Tammy Date: Fri, 31 Dec 2021 22:55:01 +0000 Subject: add GPG WKS publishing functionality Signed-off-by: Aisha Tammy --- bin/mw | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin') diff --git a/bin/mw b/bin/mw index d3129e7..fee8974 100755 --- a/bin/mw +++ b/bin/mw @@ -108,6 +108,8 @@ set trash = "+Trash" set record = "+Sent" $extra $synccmd +macro index \eg \"unset wait_keygpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; /usr/local/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"publish GPG key to WKS provider\" +macro index \eh \"/usr/local/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"confirm GPG publication\" " > "$accdir/$fulladdr.muttrc" [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" -- cgit v1.2.3 From a82a86c310bbe2c3a71ff4da3b9ed635fed4e06d Mon Sep 17 00:00:00 2001 From: Aisha Tammy Date: Mon, 10 Jan 2022 20:06:52 +0000 Subject: change path of command to use prefix Signed-off-by: Aisha Tammy --- bin/mw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/mw b/bin/mw index fee8974..d2a67d7 100755 --- a/bin/mw +++ b/bin/mw @@ -108,8 +108,8 @@ set trash = "+Trash" set record = "+Sent" $extra $synccmd -macro index \eg \"unset wait_keygpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; /usr/local/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"publish GPG key to WKS provider\" -macro index \eh \"/usr/local/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"confirm GPG publication\" +macro index \eg \"unset wait_keygpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; $prefix/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"publish GPG key to WKS provider\" +macro index \eh \"$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"confirm GPG publication\" " > "$accdir/$fulladdr.muttrc" [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" -- cgit v1.2.3