summaryrefslogtreecommitdiffstats
path: root/.local/bin/fetch_mail.sh
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-01-12 18:44:21 +0100
committerJoe <rrbo@proton.me>2023-01-12 18:44:21 +0100
commitf73a167d9bb5b0b37c1c41e3f2e19ed2bd3ab3e8 (patch)
tree99b7eca5b60d8196ffd31185423ca5224f0b2fc2 /.local/bin/fetch_mail.sh
parentup (diff)
downloaddotfiles-bsd-f73a167d9bb5b0b37c1c41e3f2e19ed2bd3ab3e8.tar.gz
dotfiles-bsd-f73a167d9bb5b0b37c1c41e3f2e19ed2bd3ab3e8.tar.bz2
dotfiles-bsd-f73a167d9bb5b0b37c1c41e3f2e19ed2bd3ab3e8.tar.xz
dotfiles-bsd-f73a167d9bb5b0b37c1c41e3f2e19ed2bd3ab3e8.tar.zst
dotfiles-bsd-f73a167d9bb5b0b37c1c41e3f2e19ed2bd3ab3e8.zip
up
Diffstat (limited to '.local/bin/fetch_mail.sh')
-rwxr-xr-x.local/bin/fetch_mail.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/.local/bin/fetch_mail.sh b/.local/bin/fetch_mail.sh
index 4faabb2..407fbdb 100755
--- a/.local/bin/fetch_mail.sh
+++ b/.local/bin/fetch_mail.sh
@@ -16,11 +16,18 @@ else
mb2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new | wc -l 2>/dev/null)"
pre_count="$((pre_count + mb1 + mb2))"
fi
+
+if [ $TERM == "dump" ]; then
+ if ! echo test | gpg2 --sign --batch --no-tty --pinentry-mode error -o /dev/null >/dev/null 2>&1; then
+ notify-send -u low -t 6000 'mbsync' ' GPG locked'
+ exit 1
+ fi
+fi
killall mbsync >/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 ||
- notify-send -u low -t 6000 'mbsync' ' failed to fetch mail' >/dev/null 2>&1
+mbsync -a -c /usr/home/jozan/.config/mbsync/mbsyncrc ||
+ 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
@@ -33,5 +40,5 @@ if [ $post_count -gt $pre_count ]; then
notify-send -u normal 'NeoMutt' ' '$post_count' new mail(s)'
fi
echo $post_count >$mc_file
-sleep 1
+# sleep 1
# kill -74 $(pidof dwmblocks) >/dev/null 2>&1