summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/mbsyncloop13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/mbsyncloop b/bin/mbsyncloop
index d55806b..4743e92 100755
--- a/bin/mbsyncloop
+++ b/bin/mbsyncloop
@@ -32,11 +32,18 @@ if (!$pid) {
exit;
}
-my $last = 0;
+my $last_all = 0;
while (1) {
my $now = time;
- my $channel = ($now - $last) > 15 * 60 ? "all" : "priority";
- $last = $now;
+
+ my $channel;
+ if ($now - $last_all > 15 * 60) {
+ $last_all = $now;
+ $channel = "all";
+ }
+ else {
+ $channel = "priority";
+ }
system("mbsync -c ~/.mbsyncloop $channel") and last;
system("notmuch new | grep -v '^No new mail\.\$'");