From bc7e6ab742b399a8181cdb81086e766d9dbbf3a5 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Fri, 18 Nov 2022 17:45:30 +0100 Subject: bin/hibiki/mailsync: add notmuch --- bin/hibiki/mailsync | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/hibiki/mailsync b/bin/hibiki/mailsync index 66d6164..b248215 100755 --- a/bin/hibiki/mailsync +++ b/bin/hibiki/mailsync @@ -37,7 +37,6 @@ notifysend() { local ico shift 2 - set -x if ! printf "%s" "$*" | grep -- "-i" >/dev/null; then ico="📨 " fi @@ -47,7 +46,6 @@ notifysend() { -a mailsync \ -c audible \ "${ico:-}${summary}" "${body}" - set +x } decode() { @@ -88,7 +86,7 @@ list_msg() { # fi } -notify() { +run_notify() { local acct=$1 local new_mail @@ -107,7 +105,7 @@ notify() { fi } -sync() { +run_sync() { local acct=$1 # exit if we're already running @@ -132,6 +130,9 @@ sync() { --object-path /org/freedesktop/Notifications \ --method org.freedesktop.Notifications.CloseNotification \ "$id" >/dev/null + + # index new messages + command notmuch >/dev/null && notmuch new } # only list new mail, don't sync @@ -146,8 +147,8 @@ for acct in "${accounts[@]}"; do list_msg "${list}" "${acct}" exit 0 # exit ()& subshell fi - sync "${acct}" - notify "${acct}" + run_sync "${acct}" + run_notify "${acct}" ) & done -- cgit 1.4.1