Beep
22 Nov 2009 01:25 UTC 2009326+0125 UTC

If you want to get your terminal bell (beep) to work on a system without a PC speaker, or want to play a custom sound through your sound card, you can use the Fancy Beeper Daemon.

Kernel Module

In order to get it to compile on intrepid, I had to tweak the includes. Here is a patch for beep.c: beep.c.pat

After you apply the patch, run install.sh to compile and install the kernel module.

The permissions on /dev/beep will probably not let you access it (unless you are root). To fix this, place the following file in /etc/udev/rules.d: 41-beep.rules. This will create /dev/beep with group audio (you will need to make sure you are in the audio group).

You can now rmmod beep; modprobe beep. You probably want to add beep to /etc/modules so that it gets installed when booting.

Daemon

You will need to run a daemon to do something useful when a beep occurs. I am running the included daemons/beepd_esd.pl. You will need to edit it to point to a valid wav file.

You can test your beep with: echo -e "\a"

I set up the daemon to run automatically via Sessions->Startup Programs (doesn't seem to work in /etc/rc.local).

Screen

If you are running screen, the visual bell may be on by default (which turns off the audible bell). To turn it on hit Ctrl+a Ctrl+g. If you want it this way every time you run screen, add "vbell off" to you .screenrc.

Irssi

In irssi you can run the following command to have it beep on certain events (such as when your nick is mentioned):

/set bell_beeps ON
/set beep_msg_level MSGS NOTICES DCC DCCMSGS HILIGHT

You can also place these settings in you .irssi/config

settings = {
  "fe-common/core" = {
    bell_beeps = "yes";
    beep_msg_level = "MSGS NOTICES DCC DCCMSG HILIGHT";
  };
};

gnome-terminal

You may want to only have the terminal bell enabled for certain things (i.e. irssi). You can do this with profiles. You can start gnome-terminal with a specific profile by adding --window-with-profile=PROFILENAME

To run a command use -x, which will treat the remainder of the line as a command to run in the terminal, i.e. gnome-terminal --window-with-profile=PROFILENAME -x screen -r

To ssh to a remote machine and run screen using a particular profile in gnome-terminal use: gnome-terminal --window-with-profile=PROFILENAME -x ssh -t remote.machine screen -r

Misc

Some (possibly) helpful links:

Page last modified on April 15, 2009, at 04:14 PM