Weechat – beep

2013-12-05-164314_439x48_scrot

There is a script called beep.pl for WeeChat. It emits a beep when someone sends you a private message, a DCC, or when someone highlights you in a channel. You can also configure the script to execute a command. I was looking for a way to differentiate between private messages, highlights and DCC. I had a discussion with nils_2 and I fell in love with his solution : the beep command. Here is how to achieve this on Debian GNU/Linux.

Install the beep program

sudo aptitude install beep

Install the script

/script install beep.pl

Configure the beeps

/set plugins.var.perl.beep.beep_command_dcc "beep -f 400"
/set plugins.var.perl.beep.beep_command_highlight "beep -f 500"
/set plugins.var.perl.beep.beep_command_pv "beep -f 600"

If you prefer to keep the normal frequency, you could specify how many beeps you want to hear with :

/set plugins.var.perl.beep.beep_command_dcc "beep"
/set plugins.var.perl.beep.beep_command_highlight "beep -r 2"
/set plugins.var.perl.beep.beep_command_pv "beep -r 3"

or the lenght of the beep :

/set plugins.var.perl.beep.beep_command_dcc "beep -l 300"
/set plugins.var.perl.beep.beep_command_highlight "beep -l 600"
/set plugins.var.perl.beep.beep_command_pv "beep -l 900"

If you run WeeChat remotely, write a script remote_beep.sh with the following content :

#!/bin/sh                 
ssh user@host "beep $1 $2"

and save the file. Then, replace beep by remote_beep.sh :

/set plugins.var.perl.beep.beep_command_dcc "remote_beep.sh -f 400"
/set plugins.var.perl.beep.beep_command_highlight "remote_beep.sh -f 500"
/set plugins.var.perl.beep.beep_command_pv "remote_beep.sh -f 600"

Enjoy!

Leave a Reply