Mon, 14 Aug 2006

irssi notification script

Having finals to deal with next week, I've been trying to avoid things that tend to waste huge amounts of time, such as email and IRC. So I wrote a little irssi script to pop up notifcation bubbles when people talk to you.

*Update (20090916)*

Years later, and I can't really vouch for this code anymore, as I don't use it. I recommend using it at your own risk, as there could potentially be security implications, since it is unmaintained. However, this script was the catalyst for a variety of improved implementations, such as irssi-libnotify, fnotify, irssi-notify, etc.

notify.pl
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
##       /load perl
##       /script load notify
##

use strict;
use Irssi;
use vars qw($VERSION %IRSSI);

$VERSION = "0.01";
%IRSSI = (
    authors     => 'Luke Macken',
    contact     => 'lewk@csh.rit.edu',
    name        => 'notify.pl',
    description => 'TODO',
    license     => 'GNU General Public License',
    url         => 'http://www.csh.rit.edu/~lewk/code/irssi-notify',
);

sub notify {
    my ($dest, $text, $stripped) = @_;
    my $server = $dest->{server};

    return if (!$server || !($dest->{level} & MSGLEVEL_HILIGHT));

    $stripped =~ s/[^a-zA-Z0-9 .,!?\@:\>]//g;
    system("notify-send -i gtk-dialog-info -t 5000 '$dest->{target}' '$stripped'");
}

Irssi::signal_add('print text', 'notify');


posted at: 06:43 | link | Tags: , | 6 comments

Posted by knez4n at Wed Aug 27 10:53:38 2008

You must have installed notify-send before

(ubuntu-> sudo apt-get install libnotify-bin)

Posted by Maxe at Wed Jul 1 15:47:07 2009

Thanks a lot for this. Linked you :)

Posted by Jonas at Wed Sep 22 11:04:02 2010

You could change 'gtk-dialog-info' to 'notification-message-im' to get the icon used for other instant messaging messages.

Posted by Nevaeh at Sun Jun 12 06:15:15 2011

This forum nedeed shaking up and you’ve just done that. Great post!

Posted by Karinthia at Sun Jun 12 07:42:30 2011

That’s more than ssnebile! That’s a great post!

Posted by michael kors outlet online at Tue Sep 23 07:58:28 2014

Hat they would you practices letting authored know which hosting company you’re bear in? woul’ve bundled your blog in the direction 3 clear out different internet browsers and i'm assuming must sight this blog loads an evident lot up then moright track. find a way to you suggest a good server colocation provider at a reasonable the money? hi and thanks, i had produced appreciate it: d


Name:


E-mail:


URL:


Comment: