diff options
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/mailsync | 9 |
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\""; } |
39 | else | 39 | else |
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"; } |
42 | fi | 42 | fi |
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. |
62 | if [ "$#" -eq "0" ]; then | 62 | if [ "$#" -eq "0" ]; then |
63 | accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")" | 63 | accounts="$(awk '/^Channel/ {print $2}' "$HOME/.config/isyncrc")" |
64 | else | 64 | else |
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=$* |
69 | fi | 69 | fi |
70 | 70 | ||
71 | # ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null | ||
72 | |||
73 | # Parallelize multiple accounts | 71 | # Parallelize multiple accounts |
74 | for account in $accounts; do | 72 | for account in $accounts; do |
75 | syncandnotify & | 73 | syncandnotify & |
76 | done | 74 | done |
77 | 75 | ||
78 | wait | 76 | wait |
79 | # ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null | ||
80 | 77 | ||
81 | notmuch new 2> /dev/null | 78 | notmuch new 2> /dev/null |
82 | 79 | ||