Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: C++ | Size: 0.77 KB | Hits: 62 | Expires: Never
Copy text to clipboard
  1. ##
  2. ## Put me in ~/.irssi/scripts, and then execute the following in irssi:
  3. ##
  4. ##       /load perl
  5. ##       /script load notify
  6. ##
  7.  
  8. use strict;
  9. use Irssi;
  10. use vars qw($VERSION %IRSSI);
  11.  
  12. $VERSION = "0.01";
  13. %IRSSI = (
  14.     authors     => 'Luke Macken',
  15.     contact     => 'lewk@csh.rit.edu',
  16.     name        => 'notify.pl',
  17.     description => 'TODO',
  18.     license     => 'GNU General Public License',
  19.     url         => 'http://lewk.org/log/code/irssi-notify',
  20. );
  21.  
  22. sub notify {
  23.     my ($dest, $text, $stripped) = @_;
  24.     my $server = $dest->{server};
  25.  
  26.     return if (!$server || !($dest->{level} & MSGLEVEL_HILIGHT));
  27.  
  28.     $stripped =~ s/[^a-zA-Z0-9 .,!\?@\:\<\>]//g;
  29.     system("xmessage \"IRC Activity!\" & ");
  30. }
  31.  
  32. Irssi::signal_add('print text', 'notify');