Created
July 4, 2009 10:19
-
-
Save kshimo69/140521 to your computer and use it in GitHub Desktop.
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
use strict; | |
use vars qw($VERSION %IRSSI); | |
use Irssi; | |
$VERSION = '0.1'; | |
%IRSSI = ( | |
authors => 'kshimo69', | |
contact => 'kshimo69@gmail.com', | |
name => 'growl_irssi', | |
description => 'send local growl with growlnotify', | |
license => 'Creative-Commons by', | |
); | |
our $script = "growlnotify"; | |
our $icon = ""; # not use. | |
our @command = ( | |
$script, | |
'-n', "irssi", | |
); | |
sub sig_message { | |
my ($server, $data, $nick, $address, $target) = @_; | |
system(@command, '-t', "$nick $target", '-m', $data); | |
} | |
sub sig_printtext { | |
my ($dest, $text, $stripped) = @_; | |
if ($dest->{level} & MSGLEVEL_HILIGHT) { | |
system(@command, '-t', $dest->{target}, '-m', $text); | |
} | |
} | |
Irssi::signal_add_last('message private', \&sig_message); | |
Irssi::signal_add_last('message public', \&sig_message); | |
Irssi::signal_add_last('message irc notice', \&sig_message); | |
Irssi::signal_add_last('print text', \&sig_printtext); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment