Created
December 21, 2015 18:45
-
-
Save a10y/a97b08d3f68230d9d0b2 to your computer and use it in GitHub Desktop.
Irssi Script for Desktop Notifications on OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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