summaryrefslogtreecommitdiffstats
path: root/.local/bin/fetch_mail.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.local/bin/fetch_mail.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/.local/bin/fetch_mail.sh b/.local/bin/fetch_mail.sh
index ed3da4a..416f7e0 100755
--- a/.local/bin/fetch_mail.sh
+++ b/.local/bin/fetch_mail.sh
@@ -1,9 +1,5 @@
#!/bin/sh
-set -f
-set +f
-set -m
-
export GNUPGHOME=$HOME/.local/share/gnupg
export PASSWORD_STORE_DIR=$HOME/.local/share/pass
@@ -11,10 +7,12 @@ mc_file="/tmp/newmailcount"
if [ -f $mc_file ]; then
pre_count=$(cat $mc_file)
else
- 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))"
+ pre_count="$(ls "${MAIL:-/var/mail/jozan}"/gmx_rbo/INBOX/new | wc -l 2>/dev/null)"
+ mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmx_shop/INBOX/new | wc -l 2>/dev/null)"
+ #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))"
fi
if ! echo test | gpg2 --sign --batch --no-tty --pinentry-mode error -o /dev/null >/dev/null 2>&1; then
@@ -22,18 +20,20 @@ if ! echo test | gpg2 --sign --batch --no-tty --pinentry-mode error -o /dev/null
exit 1
fi
killall mbsync >/dev/null 2>&1
-notify-send -u low -t 3000 'mbsync' ' fetching mail...' >/dev/null 2>&1
+notify-send -u low -t 3000 'mbsync' ' fetching mail' >/dev/null 2>&1
# {
-mbsync -a -c /usr/home/jozan/.config/mbsync/mbsyncrc ||
+mbsync -a ||
notify-send -u low -t 6000 'mbsync' ' failed to fetch mail' >/dev/null 2>&1
# }&
# gsleep 0.2
# kill -74 $(pidof dwmblocks) >/dev/null 2>&1
# fg
-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))"
+post_count="$(ls "${MAIL:-/var/mail/jozan}"/gmx_rbo/INBOX/new | wc -l 2>/dev/null)"
+mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmx_shop/INBOX/new | wc -l 2>/dev/null)"
+# 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))"
if [ $post_count -gt $pre_count ]; then
notify-send -u normal 'NeoMutt' ' '$post_count' new mail(s)'
fi