summaryrefslogtreecommitdiffstats
path: root/scripts/beep.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/beep.pl')
-rw-r--r--scripts/beep.pl50
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/beep.pl b/scripts/beep.pl
new file mode 100644
index 0000000..0bc5c53
--- /dev/null
+++ b/scripts/beep.pl
@@ -0,0 +1,50 @@
+# $Id: beep.pl,v 1.9 2002/07/04 13:18:02 jylefort Exp $
+
+use strict;
+use Irssi 20020121.2020 ();
+use vars qw($VERSION %IRSSI);
+$VERSION = "1.01";
+%IRSSI = (
+ authors => 'Jean-Yves Lefort',
+ contact => 'jylefort\@brutele.be, decadix on IRCNet',
+ name => 'beep',
+ description => 'Replaces your terminal bell by a command specified via /set; adds a beep_when_not_away setting',
+ license => 'BSD',
+ url => 'http://void.adminz.be/irssi.shtml',
+ changed => '$Date: 2002/07/04 13:18:02 $ ',
+);
+
+# /set's:
+#
+# beep_when_not_away opposite of builtin beep_when_away
+#
+# beep_command if not empty, the specified command will be
+# executed instead of the normal terminal bell
+# changes:
+#
+# 2002-07-04 release 1.01
+# * signal_add's uses a reference instead of a string
+#
+# 2002-04-25 release 1.00
+# * increased version number
+#
+# 2002-01-24 initial release
+
+sub beep {
+ my $server = Irssi::active_server;
+ if ($server && ! $server->{usermode_away}
+ && ! Irssi::settings_get_bool("beep_when_not_away")) {
+ Irssi::signal_stop();
+ } else {
+ if (my $command = Irssi::settings_get_str("beep_command")) {
+ system($command);
+ Irssi::signal_stop();
+ }
+ }
+}
+
+Irssi::settings_add_bool("lookandfeel", "beep_when_not_away", 0);
+Irssi::settings_add_str("misc", "beep_command",
+ "esdplay ~/sound/events/beep.wav &");
+
+Irssi::signal_add("beep", \&beep);