-
-
Save bavardage/118245 to your computer and use it in GitHub Desktop.
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
## | |
## 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 => '[email protected]', | |
name => 'notify.pl', | |
description => 'TODO', | |
license => 'GNU General Public License', | |
url => 'http://lewk.org/log/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'"); | |
system("notify-send -i /home/ben/Pictures/irssi_white.png -t 5000 '$dest->{target}' 'You were highlighted' &"); | |
} | |
Irssi::signal_add('print text', 'notify'); | |
my $bitlbee_channel = "&bitlbee"; | |
my $bitlbee_server_tag = "Bitlbee"; | |
sub bitlbee_message { | |
my($server, $msg, $nick, $address, $target) = @_; | |
return if $server->{tag} ne $bitlbee_server_tag; | |
system("notify-send -i /home/ben/Pictures/irssi_white.png -t 10000 '$server->{tag}' '$nick said something' &"); | |
} | |
Irssi::signal_add("message private", "bitlbee_message"); | |
#Irssi::signal_add("message public", "bitlbee_message"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment