Skip to content

Instantly share code, notes, and snippets.

@ichigotake
Created March 19, 2012 08:40
Show Gist options
  • Save ichigotake/2103306 to your computer and use it in GitHub Desktop.
Save ichigotake/2103306 to your computer and use it in GitHub Desktop.
30秒ごとに経過時間をGrowlへ通知する
#!/usr/bin/env perl
use strict;
use warnings;
use Growl::GNTP;
my $interval = $ARGV[0] > 0 ? $ARGV[0]:30;
my $growl = Growl::GNTP->new(
PeerHost => 'myhost',
AppName => 'my growl app!',
Password => 'testst'
);
$growl->register([
{
Name => 'おはよう',
DisplayName => 'teststststs',
Enabled => 'True',
Icon => ''
},
]);
my $count = 0;
while (1) {
sleep 1;
next if ++$count % $interval ne '0';
$growl->notify(
Event => 'おはよう',
Title => '時間経過の報告',
Message => "$count 秒"
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment