diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-28 15:23:27 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-28 15:23:27 -0500 |
commit | 571fdfb2e1b87f6a1fd44e22e17070c5edf4d628 (patch) | |
tree | d064e9418476db4f0e681145baf0f51e83f39531 | |
parent | 7a59ace982e14a5f44c45e40e66a3731f4434ecd (diff) | |
download | conf-571fdfb2e1b87f6a1fd44e22e17070c5edf4d628.tar.gz conf-571fdfb2e1b87f6a1fd44e22e17070c5edf4d628.zip |
fix channel selection
-rwxr-xr-x | bin/mbsyncloop | 13 |
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\.\$'"); |