Removing annoying console beeps

Posted by Steve on Fri 18 Mar 2005 at 16:06

Tags: none.

One thing that has often annoyed me about most typical Linux installations I've seen has been the annoying frequency of console beeps.

Take GNU Bash for example, my installation is setup so that I can save typing and complete filenames, directories, and command line arguments merely by pressing the TAB key. However when I type an unambigious word it beeps at me.

For the case of bash specifically I can disable this by running:

echo 'set bell-style none' >> ~/.inputrc

(This actually affects all programs that use GNU Readline).

However this does nothing to stop other programs, such as GNU Screen from also making beep noises.

However there is a simple solution to remove console beeps completely, for all programs.

Within the X11 Window System

To remove all console beeps whilst running X you should execute:

xset b off

This disables the console beep for all programs.

From the system console

To remove all console beeps whilst running from the system console execute:

setterm -blength 0

This disables the console beep for all programs, by setting the "beep length" to zero.

Each of these commands will allow you to alter other things too, and have useful and interesting man pages. To view them use one of the following commands:

man xset
man setterm

 

 


Posted by Anonymous (194.47.xx.xx) on Fri 18 Mar 2005 at 16:15
To disable beeps in GNU screen, just put
vbell on
in your ~/.screenrc file.

It's always better to turn off only the annoying beeps; then the important beeps can remain and get your attention when it's really necessary. Therefore, don't disable beeps completely in the terminal or in X; turn it off in the applications which annoy you.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 18 Mar 2005 at 16:18
[ View Steve's Scratchpad | View Weblogs ]

I guess that's a good point, to only disable annoying beeps not potentially useful ones.

I guess for me I have a short attention span and any interruption is bad.

Each to their own ..

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by linulin (84.204.xx.xx) on Sat 7 Jan 2006 at 23:56
For me full-screen visual bell is even more annoying. Sigh...

[ Parent | Reply to this comment ]

Posted by Anonymous (212.202.xx.xx) on Fri 18 Mar 2005 at 16:37
Zsh offers the parameter (environment variable) ZBEEP and three options: BEEP, HIST_BEEP and LIST_BEEP. Look them up in the manual.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 18 Mar 2005 at 16:43
[ View Steve's Scratchpad | View Weblogs ]

tcsh also allows you to disable beeps via either:

set nobeep
set visiblebell

Still the point of this piece was to disable things globally rather than on a per-application basis.

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by lindenle (192.76.xx.xx) on Sat 19 Mar 2005 at 14:09
[ View Weblogs ]
It only annoys me when i am using an xterm so i start all my xterms with the -vb option to give me a flash rather than a beep.

[ Parent | Reply to this comment ]

Posted by whizse (62.209.xx.xx) on Sat 19 Mar 2005 at 16:29
GNOME users can disable X11 beeps from the sound settings in Applications > Desktop prefs. > Sound > System bell.

This overrides any settings in the .xsession file (I found out the hard way).

[ Parent | Reply to this comment ]

Posted by Anonymous (62.167.xx.xx) on Fri 25 Mar 2005 at 22:45
I just add the pcspkr module to the hotplug blacklist...

[ Parent | Reply to this comment ]

Posted by Anonymous (64.142.xx.xx) on Wed 13 Apr 2005 at 05:00
What I really want is a system that allows different programs to produce different pleasant sonourous noises so I know the difference between IRC beeping vs syslog emergency messages.

But I'd settle for just X doing something reasonable (alsa-based) instead of pc beeper. -k8to

[ Parent | Reply to this comment ]

Posted by Anonymous (12.104.xx.xx) on Sun 23 Oct 2005 at 21:51
I love the xset command. Now how do I apply the xset command by default for say an xdm manager?

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sun 23 Oct 2005 at 23:51
[ View Steve's Scratchpad | View Weblogs ]

I admit I'm not entirely sure what you mean. However you might be able to accomplish what you want via the help of this article: Running scripts automatically when X starts.

Steve
--

[ Parent | Reply to this comment ]

Posted by Anonymous (12.104.xx.xx) on Mon 24 Oct 2005 at 00:32
That was the piece I was missing. Many thanks..

[ Parent | Reply to this comment ]

Posted by linulin (84.204.xx.xx) on Sat 7 Jan 2006 at 23:51
I use the following in my bash profile for consoles:
echo -e "\33[10;25]\33[11;10]"   #bell: 25Hz 10ms
This eliminates annoyance from the beeps. (You might want to adjust the parameters for your particular PC speaker.)

--
...Bye..Dmitry.

[ Parent | Reply to this comment ]

Posted by Anonymous (84.178.xx.xx) on Sat 19 Aug 2006 at 20:37
Thanks Dimitry. Nice solution.

[ Parent | Reply to this comment ]

Posted by linulin (89.110.xx.xx) on Fri 25 Aug 2006 at 21:30
For the sake of completeness, similar bell sound for X:

$ xset b 10 100 50

--
...Bye..Dmitry.

[ Parent | Reply to this comment ]

Posted by linulin (212.119.xx.xx) on Mon 29 Sep 2008 at 11:47

Simple 'echo' does not work since Lenny. Use '/bin/echo' instead.

--
...Bye..Dmitry.

[ Parent | Reply to this comment ]

Posted by Anonymous (139.80.xx.xx) on Sun 12 Feb 2006 at 02:17
Thank you so damn much. Normally I rip those PC Speaker Cables out :-)

[ Parent | Reply to this comment ]

Posted by Anonymous (200.17.xx.xx) on Mon 24 Jul 2006 at 16:30
Thanks a lot, you saved my life

[ Parent | Reply to this comment ]

Posted by Anonymous (81.208.xx.xx) on Sun 7 Oct 2007 at 11:22
Were you going to take suicide because of the system bell?

[ Parent | Reply to this comment ]

Posted by Anonymous (213.156.xx.xx) on Wed 28 Nov 2007 at 09:32
Edit:

"/etc/modprobe.d/blacklist"

and add line:

"blacklist pcspkr"

close editor and reboot

or:

"sudo modprobe -r pcspkr"

and reboot.

greetings

[ Parent | Reply to this comment ]

Posted by Anonymous (193.144.xx.xx) on Fri 3 Apr 2009 at 11:29
no need to reboot

[ Parent | Reply to this comment ]

Posted by Anonymous (130.161.xx.xx) on Mon 31 Mar 2008 at 10:08
Thank you for saving my sanity...

[ Parent | Reply to this comment ]

Posted by Anonymous (80.95.xx.xx) on Wed 2 Dec 2009 at 08:27
Thanks a lot!! The shell is like crazy, it beeps all the time even when it is clear that you are watching the terminal (e.g. when completing file name on the command line). It beeps so often that when your attention is really needed you just ignore it.

[ Parent | Reply to this comment ]

Posted by Anonymous (90.227.xx.xx) on Thu 3 Nov 2011 at 23:26
Or you could remove the pcspkr module
> rmmod pcspkr
> echo 'blacklist pcspkr' >> /etc/modprobe.d/blacklist.conf

[ Parent | Reply to this comment ]

Posted by Anonymous (79.247.xx.xx) on Fri 6 Apr 2012 at 11:48
awesome

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

What do you use for configuration management?








( 153 votes ~ 0 comments )