Skip to content

Instantly share code, notes, and snippets.

@baldur
Forked from bryanwoods/notifier.pl
Created August 30, 2012 21:40
Show Gist options
  • Save baldur/3541878 to your computer and use it in GitHub Desktop.
Save baldur/3541878 to your computer and use it in GitHub Desktop.
Perl script to send mentions of my name in IRC to Notification Center or whatever it's called
use strict;
use warnings;
use Irssi;
Irssi::signal_add 'message public', 'sig_message_public';
sub sig_message_public {
my ($server, $msg, $nick, $nick_addr, $target) = @_;
if ($msg =~ /ryan/) {
$msg =~ s/\'/\\'/g;
`terminal-notifier -message '$msg';`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment