From 2b1f3bb9c348c05dd43c7185c07c49a45a70de48 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 11 Aug 2012 19:57:38 -0500 Subject: script to keep notmuch up to date --- bin/watch_mail | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bin/watch_mail (limited to 'bin') diff --git a/bin/watch_mail b/bin/watch_mail new file mode 100644 index 0000000..44c4a51 --- /dev/null +++ b/bin/watch_mail @@ -0,0 +1,19 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.014; + +use Linux::Inotify2; + +my $inotify = Linux::Inotify2->new; +for my $dir (`find $ENV{HOME}/Maildir -name cur`) { + chomp $dir; + $inotify->watch($dir, IN_MODIFY|IN_MOVED_TO|IN_CREATE|IN_DELETE); +} + +$inotify->blocking(1); + +while (1) { + my @e = $inotify->read; + system("notmuch new > /dev/null 2>&1"); +} -- cgit v1.2.3-54-g00ecf