summaryrefslogtreecommitdiffstats
path: root/.local/bin/fetch_mail.sh
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-09-28 10:58:26 +0200
committerJoe <bousset.rudy@gmail.com>2022-09-28 10:58:26 +0200
commit7c94bbe950f5a2554180774d0cfe45fff80f1731 (patch)
treec80950ca99d8b8b199116b053d30917f0797e638 /.local/bin/fetch_mail.sh
parentup (diff)
downloaddotfiles-bsd-7c94bbe950f5a2554180774d0cfe45fff80f1731.tar.gz
dotfiles-bsd-7c94bbe950f5a2554180774d0cfe45fff80f1731.tar.bz2
dotfiles-bsd-7c94bbe950f5a2554180774d0cfe45fff80f1731.tar.xz
dotfiles-bsd-7c94bbe950f5a2554180774d0cfe45fff80f1731.tar.zst
dotfiles-bsd-7c94bbe950f5a2554180774d0cfe45fff80f1731.zip
up
Diffstat (limited to '.local/bin/fetch_mail.sh')
-rwxr-xr-x.local/bin/fetch_mail.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/.local/bin/fetch_mail.sh b/.local/bin/fetch_mail.sh
index c30e309..0375f41 100755
--- a/.local/bin/fetch_mail.sh
+++ b/.local/bin/fetch_mail.sh
@@ -12,9 +12,10 @@ if [ -f $mc_file ]; then
pre_count=$(cat $mc_file)
else
pre_count="$(ls "${MAIL:-/var/mail/jozan}"/main/INBOX/new | wc -l 2>/dev/null)"
- tmp1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)"
- tmp2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)"
- pre_count="$((pre_count + tmp1 + tmp2))"
+ mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)"
+ mb2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)"
+ mb3="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new | wc -l 2>/dev/null)"
+ pre_count="$((pre_count + mb1 + mb2 + mb3))"
fi
killall mbsync >/dev/null 2>&1
# notify-send -u low -t 3000 'mbsync' ' fetching mail...' >/dev/null 2>&1
@@ -26,9 +27,10 @@ gsleep 0.2
kill -74 $(pidof dwmblocks) >/dev/null 2>&1
fg
post_count="$(ls "${MAIL:-/var/mail/jozan}"/main/INBOX/new | wc -l 2>/dev/null)"
-tmp1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)"
-tmp2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)"
-post_count="$((post_count + tmp1 + tmp2))"
+mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)"
+mb2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)"
+mb3="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new | wc -l 2>/dev/null)"
+post_count="$((post_count + mb1 + mb2 + mb3))"
if [ $post_count -gt $pre_count ]; then
notify-send -u normal 'NeoMutt' ' '$post_count' new mail(s)'
fi