10

How to disable system beep on Linux? I don't have superuser powers so I cannot recompile kernel/unload module.

tshepang
  • 64,472
  • 86
  • 223
  • 290
Maciej Piechotka
  • 16,578
  • 11
  • 57
  • 93

3 Answers3

11

For beeps generated in your shell (which seem to be the most annoying ones), add this to "~/.inputrc":

set bell-style none

Note that this is not terminal- but host-specific. That means that when you log in to another computer via ssh where this isn't set, the beep is back. (I tested on Fedora)

tshepang
  • 64,472
  • 86
  • 223
  • 290
fschmitt
  • 8,720
  • 35
  • 46
  • That's not going to help; all it does is tell certain applications (such as the shell) that *you* do not want them to beep. It won't effect other users, and it wouldn't really do anything in the case of non-local logins anyway: their terminal bell is on **their** terminal, not the console. – SamB Sep 29 '10 at 21:43
  • 6
    Please read the question and my answer: He isn't root and wants to do it for his user account and that it only helps in the local shell is explicitly stated in my answer. – fschmitt Sep 30 '10 at 06:58
  • 3
    **Mind the gap**: existing ~/.inputrc *overrides* /etc/inputrc, which can have defined some interesting things. For example on Debian this can break Ctrl+Left/Right for words and/or some Rxvt-specific bindings--See [this question](http://unix.stackexchange.com/q/108098/9365). – Alois Mahdal Jan 06 '14 at 22:11
2

There's various levels at which beeps can be controlled by the user. Here's some I'm aware of:

APPLICATION LEVEL

  • export LESS="$LESS"' -q' - adds -q to the default options for less so it doesn't ring the bell (eg. when trying to scroll past the end of a file)
  • echo 'set bell-style none' >> ~/.inputrc - disables bell for all applications using readline (restart your terminal to see effect)

TERMINAL LEVEL

  • xterm -vb - enables "visual bell", which flashes the terminal window instead of making an audible noise. You can add xterm*visualBell: true to your X resources (~/.Xdefaults) to change the default. Most terminal emulators include a similar option.

X SERVER LEVEL

  • xset b off - disables X server bell

MACHINE LEVEL?

  • alsamixer - mute or turn down the Speaker and Bell channels

In my case muting the ALSA channels didn't help - I still got a bell sometimes from the builtin speaker (even with headphones plugged in). But disabling the X server bell got rid of it.

pooya13
  • 103
  • 3
sqweek
  • 141
  • 2
1

Have you already unchecked "Enable system beep" in System -> Preferences -> Sound -> System Beep?

krissi
  • 553
  • 4
  • 10