Skip to content

Instantly share code, notes, and snippets.

@soh335
Created March 14, 2010 16:15
Show Gist options
  • Save soh335/332056 to your computer and use it in GitHub Desktop.
Save soh335/332056 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use AnyEvent;
my $cv_timer = AnyEvent->condvar;
my $timer = AnyEvent->timer (
after => 5,
interval => 5,
cb => sub {
my $lines = `ps ax | grep java`;
`/usr/bin/osascript run-processing.scpt` unless $lines =~ /processing\.core\.PApplet/;
},
);
$cv_timer->recv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment