Created
March 19, 2012 08:40
-
-
Save ichigotake/2103306 to your computer and use it in GitHub Desktop.
30秒ごとに経過時間をGrowlへ通知する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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