Skip to content

Instantly share code, notes, and snippets.

@kshimo69
Created July 4, 2009 10:19
Show Gist options
  • Save kshimo69/140521 to your computer and use it in GitHub Desktop.
Save kshimo69/140521 to your computer and use it in GitHub Desktop.
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