86

I use Nautilus to explore my files. I use a Debian-based OS with KDE Plasma 5.

I use the keyboard a lot. When I press the key up when navigating files, if I'm already at the extremity of the list of files, Nautilus sends a big system beep which I will hear at 100% volume through my headphones. My reaction is comparable to getting electrified.

I have placed the following lines in ~/.bashrc for the sudo (root) user and for my regular desktop user:

# Turn off system beep in console:
xset b off
xset b 0 0 0

However, despite the beep going away from some places in the OS (such as erasing an empty line in the gnome-terminal), it's still in Nautilus. I believe it's because Nautilus doesn't source any of the .bashrc or because it ignores the xset commands.

How do I fix this?

What I need might be at a deeper level than the .bashrc, some file that is executed by everything, but which can still control the sound. Otherwise, disabling the sound another way or replacing it could be interesting.

10
  • 3
    Is it a system beep (so loud tone), or sound (bark/drip/dong etc for gnome)? If its the former its probably system level (in which case, try disabling the pcspkr module, or using a different sound card - if its the latter you will have to turn off the sound in system settings (including Gnome's as in Stephen's answer)
    – Wilf
    Jul 2, 2018 at 12:01
  • 10
    Just to make it explicit for those who didn't realize it: ~/.bashrc is the user configuration file of the bash shell, the default Debian terminal shell. If you realize that, it's pretty obvious why bash settings do not affect other applications like Nautilus.
    – MSalters
    Jul 2, 2018 at 12:04
  • 3
    Some sound cards have the system beep as a separate channel which can be muted. Jul 2, 2018 at 12:25
  • 3
    Try using ~/.profile instead of ~/.bashrc. As noted by @MSalters, ~/.bashrc is run when you open a new terminal, and not when you log in. ~/.profile is run when you log in. (Laughed good on your reaction, I've experienced it myself!)
    – Teodor
    Jul 2, 2018 at 15:56
  • 18
    Wire cutters; just cut it out ^^
    – esoterik
    Jul 2, 2018 at 17:16

6 Answers 6

55

I do not know what sound KDE does, but if you mean system beep, just disable loading of the pcspkr module. As root do:

rmmod pcspkr ; echo "blacklist pcspkr" >>/etc/modprobe.d/blacklist.conf

4
  • 3
    This only disables the PC speaker, which Nautilus doesn't use. You're solving the wrong problem. Jul 3, 2018 at 11:10
  • 6
    I was amused yet annoyed to learn my new Lenovo laptop has a speaker. Every time I hit backspace one too many times, have a failed Ctrl+F search in Firefox, have a failed tab completion... always this loud, obnoxious beep. Instead of configuring each piece of software, removing the pcspkr mod worked! (I needed to use /sbin/rmmod by the way, PATH was not set correctly for root.)
    – Luc
    Sep 14, 2018 at 19:45
  • I have a Lenovo Y700 and I also was surprise that it has the old and good PC Speaker inside. So this solution worked to me! Thank you. No more annoying bells and beeps.
    – Felipe
    Jun 9, 2020 at 22:52
  • 2
    After an Debian upgrade from Bullseye to Woodworm(currently "testing"), obnoxious popping sounds started aggravating me on keystrokes like @Luc reports. I had previously disabled all sound effects I could. Indeed disabling this damn module worked. What a waste of time to have to deal with this. This answer may or may not have been suited for the original question, but likely to be spot on for future readers. Thank you Edheldil
    – j-m
    Oct 16, 2021 at 5:18
45

Short of muting the sound entirely or disconnecting your headphones, there is no system-wide setting for events which will be followed by all applications. In your case especially, since you’re using Nautilus on a KDE system, you’ll run into issues since Nautilus won’t follow your desktop’s configured behaviour.

Nautilus uses GNOME’s settings. If you have the GNOME control centre, you can disable sound effects there — go to the sound settings, and disable sound effects. Alternatively, run dconf-editor, go to “org/gnome/desktop/sound”, and disable “event-sounds” and “input-feedback-sounds”. You can do this from the command line too, see How to turn off alert sounds/sound effects on Gnome from terminal? for details.

5
  • I don't think this is true. If it is using the PC speaker, you can disable that globally.
    – forest
    Jul 3, 2018 at 7:52
  • 8
    @forest the question states “Nautilus will send a big system beep which I will hear at 100% volume through my headphones”. That can’t be disabled by disabling the PC speaker. Jul 3, 2018 at 7:57
  • Nitpicking, but there is a kernel configuration setting that sends requests to trigger the PC speaker through the ALSA driver instead, but I don't know if any distros actually do that by default. But that's probably not the case, so good point.
    – forest
    Jul 3, 2018 at 7:59
  • 7
    @forest there’s really a terminology issue in the question — Nautilus doesn’t use the system beep. Jul 3, 2018 at 8:00
  • Thanks, it worked. dconf-editor path “org/gnome/desktop/sound” had beep sound(event sounds) on. I turned it off.
    – mss
    May 29, 2020 at 4:55
13

To mute Gnome alerts:

$ dconf write /org/gnome/desktop/sound/event-sounds "false" 

Equivalently:

$ gsettings set org.gnome.desktop.sound event-sounds false
2
  • 1
    Oops, this duplicates Stephen Kitt's answer. Consider this the tl;dr version. Jul 3, 2018 at 19:20
  • I think this is more direct to the solution. But both are great answers! Feb 28 at 21:52
1

The xset command you're using operates on the X server/X session, not the terminal, so .bashrc or similar is not the right place to put it. If Nautilus is really beeping via the X server's bell function, I would expect the xset to stop it, if you've already opened a terminal (and thereby run the command) beforehand.

If that works, what you need to do is get the command run as part of starting/logging in under X. The traditional way to do this is via a .xsession or .xinitrc file; however, these files (scripts) were traditionally expected to run your window manager/desktop environment session program, as the final line via exec, and if you just go dropping in a script containing nothing but xset, you might find yourself unable to login under X (rather, immediately getting logged out when you do). Figuring out the right thing to do here is going to be somewhat specific to the OS/distro's X and desktop environment setup, so I feel like I'm leaving this answer somewhat incomplete, but as a source of direction for where to look.

1

I ran into the same issue on Zorin 16 (Zorin 16, GNOME Shell 3.38.4).

In the settings dialog you can set the Alert sound to a few builtin options Default, Bark, Glass... However there is no option to disable it. I chose to hide the glass.ogg sound file. Glass being transparent, I found it the most obvious association with no sound among the builtin options.

sudo mv /usr/share/sounds/gnome/default/alerts/glass.ogg /usr/share/sounds/gnome/default/alerts/hide_glass.ogg

As a result, picking the "Glass" sound will effectively mute the alert sound, while keeping the option to re-enable the alert sound if/when desired.

I also disabled the Terminal bell in the Terminal preferences. Those two measures seem to cover it for me.

0

I've tried every single thing in this article, and more, and none of them worked. Sure some disabled the system beep for the terminal application, but all of the OS-related beeps were still on. What finally worked? Finding and renaming the dang sound file (and logging out and back in to my X session). /usr/share/sounds/ubuntu/stereo/bell.ogg I renamed the above to bell2.ogg.

sudo mv /usr/share/sounds/ubuntu/stereo/bell.ogg /usr/share/sounds/ubuntu/stereo/bell2.ogg

Now I can use my computer without wanting to flip my desk over.

Who the hell thought a super loud beep every time you pressed a key was a good idea? It's like some sort of weird psychological experiment.

Note, this will probably revert itself if the ubuntu-sounds package requires an upgrade, and you'll need to re-move the file off.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.