diff options
author | Joe <rrbo@proton.me> | 2023-01-12 11:37:14 +0100 |
---|---|---|
committer | Joe <rrbo@proton.me> | 2023-01-12 11:37:14 +0100 |
commit | 524a6e927cc3691367dcb9469492b7f3f92ac99b (patch) | |
tree | abee7623e5be8ebc6411f0e3982fbba1b1da68c2 | |
parent | up (diff) | |
download | dotfiles-bsd-524a6e927cc3691367dcb9469492b7f3f92ac99b.tar.gz dotfiles-bsd-524a6e927cc3691367dcb9469492b7f3f92ac99b.tar.bz2 dotfiles-bsd-524a6e927cc3691367dcb9469492b7f3f92ac99b.tar.xz dotfiles-bsd-524a6e927cc3691367dcb9469492b7f3f92ac99b.tar.zst dotfiles-bsd-524a6e927cc3691367dcb9469492b7f3f92ac99b.zip |
up
Diffstat (limited to '')
-rwxr-xr-x | .local/bin/fetch_mail.sh | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/.local/bin/fetch_mail.sh b/.local/bin/fetch_mail.sh index 0375f41..f9eee36 100755 --- a/.local/bin/fetch_mail.sh +++ b/.local/bin/fetch_mail.sh @@ -11,11 +11,10 @@ mc_file="/tmp/newmailcount" 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)" - 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))" + pre_count="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)" + mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)" + mb2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new | wc -l 2>/dev/null)" + pre_count="$((pre_count + mb1 + mb2))" fi killall mbsync >/dev/null 2>&1 # notify-send -u low -t 3000 'mbsync' ' fetching mail...' >/dev/null 2>&1 @@ -26,11 +25,10 @@ killall mbsync >/dev/null 2>&1 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)" -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))" +pre_count="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)" +mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)" +mb2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new | wc -l 2>/dev/null)" +post_count="$((post_count + mb1 + mb2))" if [ $post_count -gt $pre_count ]; then notify-send -u normal 'NeoMutt' ' '$post_count' new mail(s)' fi |