Skip to content

Instantly share code, notes, and snippets.

Created February 16, 2011 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/829906 to your computer and use it in GitHub Desktop.
Save anonymous/829906 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use warnings;
use strict;
my %chats;
undef $chats{"#$_"} for qw(
webgui
flea
);
my $content = do { local $/; <STDIN> };
my ($chat, $msg) = split /\s+/, $content, 2;
$chat =~ s/^\(//;
$chat =~ s/\)$//;
exit unless exists $chats{$chat};
my $title = "($chat) $ARGV[0]";
open my $child, '|-', '/usr/local/bin/growlnotify', $title, qw(-a Adium);
print $child $msg;
close $child;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment