Created
February 1, 2011 04:49
-
-
Save jasonmay/805425 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 Irssi; | |
use vars qw($VERSION %IRSSI); | |
$VERSION = "0.01"; | |
%IRSSI = ( | |
authors => "Jason May", | |
contact => '[email protected]', | |
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