[ Team LiB ] Previous Section Next Section

The bell Command

The bell command rings the terminal bell. The bell is associated with the display; even if you are executing your program on a remote machine, the bell is heard by the user. If your application has windows on multiple displays, you can direct the bell to the display of a particular window with the -displayof option. The syntax for the bell command is given below:

bell ?-displayof window? ?-nice?

UNIX has an xset program that controls the bell's duration, pitch, and volume. The volume is in percent of a maximum, for example, 50. In practice, many keyboard bells only support a variable duration; the pitch and volume are fixed. The arguments of xset that control the bell are shown below.

exec xset b ?volume? ?hertz? ?milliseconds?

The b argument by itself resets the bell to the default parameters. You can turn the bell off with -b, or you can use the on or off arguments.

exec xset -b
exec xset b ?on? ?off?

The bell command has the side effect on most systems of resetting the screen saver for the screen, which usually makes the screen visible again. In Tk 8.4, a -nice option was added to prevent the bell command from resetting the screen saver.

    [ Team LiB ] Previous Section Next Section