Skip to content

Instantly share code, notes, and snippets.

@jasonmay
Created February 1, 2011 04:49
Show Gist options
  • Save jasonmay/805425 to your computer and use it in GitHub Desktop.
Save jasonmay/805425 to your computer and use it in GitHub Desktop.
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "0.01";
%IRSSI = (
authors => "Jason May",
contact => 'jason.a.may@gmail.com',
name => 'alertsfile',
description => 'Send all hilight messages to a file for external apps to process',
license => "Public Domain",
url => "http://irssi.org/",
changed => "2002-03-04T22:47+0100"
);
sub sig_printtext {
my ($dest, $text, $stripped) = @_;
if (($dest->{level} & (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS)) &&
($dest->{level} & MSGLEVEL_NOHILIGHT) == 0) {
$window = Irssi::window_find_name('hilight');
open my $fh, '>>', "$ENV{HOME}/.growl-alerts";
print $fh "$stripped\n";
close $fh;
}
}
Irssi::signal_add('print text', 'sig_printtext');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment