Created
February 6, 2013 14:06
-
-
Save kennyp/4722699 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use POSIX qw(setsid); | |
&daemonize; | |
exec("mplayer -really-quiet -noar /usr/share/sounds/gnome/default/alerts/glass.* &> /dev/null"); | |
sub daemonize { | |
chdir '/' or die "Can't chdir to /: $!"; | |
open STDIN, '/dev/null' or die "Can't read /dev/null: $!"; | |
open STDOUT, '/dev/null' or die "Can't read /dev/null: $!"; | |
defined(my $pid = fork) or die "Can't fork: $!"; | |
exit if $pid; | |
setsid or die "Can't start a new session: $!"; | |
umask 0; | |
} |
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
use strict; | |
use Irssi; | |
use vars qw($VERSION %IRSSI); | |
$VERSION = '0.1'; | |
%IRSSI = ( | |
authors => 'Kenny Parnell', | |
contact => '[email protected]', | |
name => 'sounds', | |
description => 'Play sounds for different events in irssi.', | |
license => 'GNU General Public License' | |
); | |
sub priv_msg { | |
my ($server,$msg,$nick,$address,$target) = @_; | |
`~/.irssi/play-glass`; | |
} | |
Irssi::signal_add("message private", "priv_msg"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the mac inclined:
exec("mplayer -really-quiet -noar /System/Library/Sounds/Purr.aiff &> /dev/null");