Added SILC Thread Queue API
[crypto.git] / apps / irssi / scripts / beep.pl
1 # $Id$
2
3 use Irssi 20020121.2020 ();
4 $VERSION = "0.10";
5 %IRSSI = (
6           authors     => 'Jean-Yves "decadix" Lefort',
7           contact     => 'jylefort\@brutele.be, decadix on IRCNet',
8           name        => 'beep',
9           description => 'Replaces your terminal bell by a command specified via /set; adds a beep_when_not_away setting',
10           license     => 'BSD',
11           changed     => '$Date$ ',
12 );
13
14 # /set's:
15 #
16 #       beep_when_not_away      opposite of builtin beep_when_away
17 #
18 #       beep_command            if not empty, the specified command will be
19 #                               executed instead of the normal terminal bell
20
21 use strict;
22
23 sub beep {
24   my $server = Irssi::active_server;
25   if ($server && ! $server->{usermode_away}
26       && ! Irssi::settings_get_bool("beep_when_not_away")) {
27     Irssi::signal_stop();
28   } else {
29     if (my $command = Irssi::settings_get_str("beep_command")) {
30       system($command);
31       Irssi::signal_stop();
32     }
33   }
34 }
35
36 Irssi::settings_add_bool("lookandfeel", "beep_when_not_away", 0);
37 Irssi::settings_add_str("misc", "beep_command",
38                         "esdplay ~/sound/events/beep.wav &");
39
40 Irssi::signal_add("beep", "beep");