Skip to content

Instantly share code, notes, and snippets.

@a10y
Created December 21, 2015 18:45
Show Gist options
  • Save a10y/a97b08d3f68230d9d0b2 to your computer and use it in GitHub Desktop.
Save a10y/a97b08d3f68230d9d0b2 to your computer and use it in GitHub Desktop.
Irssi Script for Desktop Notifications on OS X
#
# Title: osx-notify-mention.pl
# Author: Andrew Duffy <[email protected]>
# Descrption: A no-deps irssi script that sends desktop notifications on OSX
# when a message comes into a channel you've joined that mentions
# your nick.
#
use strict;
use Irssi;
sub notify_nick_match {
my ($server, $msg, $nick, $address, $target) = @_;
if ($msg =~ m/$server->{nick}/i) {
`osascript -e 'display notification "$msg" with title "$target - $nick"'`
}
}
Irssi::signal_add('message public', 'notify_nick_match');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment