#!/usr/bin/perl # Author: Hai Binh Nguyen # Name: beep.pl # Desc: run customised command on hilight event use strict; use vars qw ($VERSION %IRSSI); use Irssi; $VERSION = "2004-02-28"; %IRSSI = ( authors => 'b1nhb00ng', contact => 'bb@vnlinux.org', name => 'beep', description => 'run customised command on hilight event', license => 'GPLv2', url => 'http://www.zecoj.com', ); 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", "beep -l 70 -r 1 -f 5500&"); Irssi::signal_add("beep", "beep");