Irssi improved notification script


I don’t use IRC very much, but when I do, I use Irssi.

I don’t bother with a lot of customisation, and just use adv_windowlist.pl just to tidy up the display a little more. However, I do like the irssi-libnotify wrapper which uses a system call to notify-send to throw a popup to wherever your notification area lives.

But, why you no line-wrap! It’s annoying having one line messages of 200 characters sprawling across the screen. So I had to try to dig out a Perl function to word-wrap. It seems to work but given this is the first time I’ve been anywhere near Perl, who knows.

$message =~ s/(.{1,79}\S|\S+)\s+/$1
/mg;

And it doesn’t echo your own nick back to you. I know the message is to me – I don’t need to be told again. And it stays on display long enough for me to read it.

# Remove my nick based on first whitespace
$stripped =~ s/^\S+\s+//;

Irssi::settings_add_str('notify', 'notify_time', '10000');

There’s also an icon in the zip but the location is hardcoded into the notify.pl script so you’ll have to edit that.

Irssi::settings_add_str('notify', 'notify_icon', '/home/mark/.irssi/irssi-icon.png');

If it’s of use to someone…

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>