Just stop beeping

This entry should be titled something like "Disabling the not-so-useful beep from the PC Speaker in opensuse leap 42.1", but the shorter the better

OK, it is all right to have an alarm ringing from time to time. But only when something alarming is really going on, not for the cursor trying to go beyond the end of a line, or when a command is not found.

Alarms are intended to caught your attention if something gets wrong, and the best example is a fire alarm, that won't stop sounding even if it is burning.

Rings from triangles or spherical shaped resonators (even bells) are fine to call you for a break in school, and that sounds only a couple of times a day, for a few seconds.

If a process is fine, nothing out of control, then a steady green light will do the job.

So it is really annoying when the computer, a mostly silent machine, humbly humming from its hard-disk (rotary) disks or fans, starts beeping out loud instead of given some interesting information.

So this post is to show how to disable the beeps from the standard configuration in opensuse leap 42.1, and substitute them with some blinking, or with anything.

The beep can come from the BIOS of the machine, but this is not the post to look for it. Also from the OS, and this is something that the kernel and drivers are responsible of, so I think it is a good idea not to change this behavior. And next layer is a shell (a login one), in the black and white domain of TTY. This is a place to look for. And the next layer is the graphical interface (XWindows and all the mutants!). Last are any of the applications.

As we have to find many places where the machine speaker (ye olde PC bones) beeps (beep from now on), we should look for beep(s), bell(s), ring(s), alarm(s), flash(s).

So let's start with the shell. As per default the OS uses the bash shell, the configuration files are (from man bash)

       /etc/profile
              The system wide initialization file, executed for login shells
             
       ~/.bash_profile
              The personal initialization file, executed for login shells
       ~/.bashrc
              The individual per-interactive-shell startup file
       ~/.bash_logout
              The individual login shell cleanup file, executed when a login shell exits

       /etc/inputrc
              System readline initialization file
       ~/.inputrc
              Individual readline initialization file

The "/etc/profile" has a lots of checks for many different shells. But not a single reference to beep, sound or bell. Has an important warning not to edit or change things here, as they will be lost

Also there is a "$HOME/.profile", that allows you to select the languaje when the bash shell is a login one. A login one is the kind that is started from a TTY screen, and a no login one is the one that we get from konsole, yakuake or xterm.

There are no "~/.bash_profile" and "~/.bash_logout"

My "~/.bashrc" does not include any command related with the beep

The "/etc/inputrc" tries to detect on wich terminal (physical or emulated) the bash started and how to respond to different keyboards. But there are not a single single reference to any bell, beep or alarm.

The "~/.inputrc" in my user dir got, a few years ago, a nice change:

    #
    # The bell style used e.g. on error or tab completion, possible values
    # are `none', `visible', and `audible' the ringing the bell.
    #
    set bell-style visible

This makes that when the command to be issued is written wrong, the screen blinks in silence. This behavior shows up in the login shells in TTY, in xterm, in lxterm, in mate terminal but does not show in konsole.

As all of them remain in silence, let's say that the "~/.inputrc" is the good place to set this command to kept the bell in silence and visible.

On KDE Plasma 5 (well, as far as I know, today 2016-12-30 the KDE is an hybrid between 4 and 5) on the setup screen, I have disabled on every accessibility feature any blink or sound. And I'm positive that these features are useful, but not in my day to day.

So now I have a more silent machine...









Comentarios