summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/mailsync9
1 files changed, 3 insertions, 6 deletions
diff --git a/.local/bin/mailsync b/.local/bin/mailsync
index cc7010b..40a2dee 100755
--- a/.local/bin/mailsync
+++ b/.local/bin/mailsync
@@ -37,8 +37,8 @@ if [ "$(uname)" = "Darwin" ]; then
37 notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2; } 37 notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2; }
38 messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\""; } 38 messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\""; }
39else 39else
40 notify() { notify-send --icon="mail_new" --app-name="excerpt" "\`$1\`" "📬 $2 new mail(s)"; } 40 notify() { notify-send --icon="mail_new" --app-name="mailsync" "\`$1\`" "📬 $2 new mail(s)"; }
41 messageinfo() { notify-send --icon="mail-mark-unread" --app-name="mutt" "📧 $from" "$subject"; } 41 messageinfo() { notify-send --icon="mail-mark-unread" --app-name="mailsync" "📧 $from" "$subject"; }
42fi 42fi
43 43
44# Check account for new mail. Notify if there is new content. 44# Check account for new mail. Notify if there is new content.
@@ -60,7 +60,7 @@ syncandnotify() {
60 60
61# Sync accounts passed as argument or all. 61# Sync accounts passed as argument or all.
62if [ "$#" -eq "0" ]; then 62if [ "$#" -eq "0" ]; then
63 accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")" 63 accounts="$(awk '/^Channel/ {print $2}' "$HOME/.config/isyncrc")"
64else 64else
65 for arg in "$@"; do 65 for arg in "$@"; do
66 [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 66 [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1
@@ -68,15 +68,12 @@ else
68 accounts=$* 68 accounts=$*
69fi 69fi
70 70
71# ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null
72
73# Parallelize multiple accounts 71# Parallelize multiple accounts
74for account in $accounts; do 72for account in $accounts; do
75 syncandnotify & 73 syncandnotify &
76done 74done
77 75
78wait 76wait
79# ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null
80 77
81notmuch new 2> /dev/null 78notmuch new 2> /dev/null
82 79