How to disable system beep for non-privileged user

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

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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)

Method 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.

Method 3

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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x