diff options
| author | Robert Günzler <r@gnzler.io> | 2022-11-18 17:45:30 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-11-18 18:38:21 +0100 |
| commit | bc7e6ab742b399a8181cdb81086e766d9dbbf3a5 (patch) | |
| tree | 32579869d62550996dee61accbe76f4aab187087 | |
| parent | 35b28adfbfda4c6c6058e52c77191e52554795aa (diff) | |
bin/hibiki/mailsync: add notmuch
| -rwxr-xr-x | bin/hibiki/mailsync | 13 |
1 files changed, 7 insertions, 6 deletions
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 |