summaryrefslogtreecommitdiffstats
path: root/.local/bin/fetch_mail
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.local/bin/fetch_mail9
1 files changed, 3 insertions, 6 deletions
diff --git a/.local/bin/fetch_mail b/.local/bin/fetch_mail
index eaee5fb..04df4b3 100755
--- a/.local/bin/fetch_mail
+++ b/.local/bin/fetch_mail
@@ -13,7 +13,7 @@ sub test_gpg
$ret = system("echo test | gpg2 --sign --batch --no-tty --pinentry-mode error -o /dev/null >/dev/null 2>&1");
if ($ret != 0) {
- notify(" gpg locked | can't fetch mails");
+ notify("[!] gpg locked | can't fetch mails");
}
return $ret;
}
@@ -37,7 +37,7 @@ sub get_new_mail
$ret = system('mbsync', $acc);
if ($ret != 0) {
- notify(" $acc: failed to sync mails");
+ notify("[!] $acc: failed to sync mails");
}
return;
}
@@ -80,13 +80,10 @@ sub fetch_thread
open($fh, '+>', $mc_file) or die $!;
$pre_count = -1;
}
- # if ($pre_count == -1) {
- # $pre_count = count_new_mails($_, $maildir);
- # }
get_new_mail($acc);
my $post_count = count_new_mails($acc);
if ($post_count > $pre_count && $post_count > 0) {
- my $notify_str = ' ' . $acc . ': ' . $post_count . ' new mail';
+ my $notify_str = '[mail] ' . $acc . ': ' . $post_count . ' new mail';
$notify_str .= ($post_count > 1 ? "s\n" : "\n");
notify($notify_str)
}