Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for audio bell #1528

Closed
Yavor-Ivanov opened this issue Aug 30, 2018 · 19 comments · Fixed by #3848
Closed

Add support for audio bell #1528

Yavor-Ivanov opened this issue Aug 30, 2018 · 19 comments · Fixed by #3848

Comments

@Yavor-Ivanov
Copy link

Which operating system does the issue occur on?
macOS High Sierra v10.13.6

I don't get any audio notification for the terminal bell. The config file has options for visual_bell, but that's of no help when I'm looking at other fullscreen windows.

For the time being, I've worked around the problem using tmux:

# Some hacks for OSX Alacritty audio bell
set -g monitor-bell on
set -g bell-action other
set-hook -g alert-bell 'run-shell "afplay /System/Library/Sounds/Funk.aiff"'

Does Alacritty not provide an audio bell? If not, is the feature planned or out of scope?

@chrisduerr
Copy link
Member

Currently Alacritty does not provide any audio bell and it's not planned to add this in the near future.

Judging if this is within scope or not is always tough since it might change based on demand (see scrollback which was initially not planned). However there already are a few issues which are related to this issue (see #1170 and #1072). Especially with #1072 I can see Alacritty supporting it in the future.

@Yavor-Ivanov
Copy link
Author

Thanks for the swift reply! I can live with notifications via tmux, just wanted to make sure I'm not missing anything :-)

@jwilm jwilm changed the title Audio bell missing? Add support for audio bell Sep 5, 2018
@Celti
Copy link
Contributor

Celti commented Sep 30, 2018

Given the varying nature of the demands for this feature, and the constant doubt as to whether it's in scope — maybe shove it off onto the user and add a bell_command configuration option? People who don't care can use (or not) the visual bell as desired. People who do can use whatever external bell they wish (likely xkbbell on Linux/X11, or osascript -e 'beep' on MacOS, for the "default" system beep in each).

@jwilm
Copy link
Contributor

jwilm commented Oct 8, 2018

I like @Celti's suggestion

@HendrikPetertje
Copy link

I've included the bit of code from the top (playing a sound, even emiting a shell script to light up a small led-light on my desk just to test if an error was raised in tmux). while in iterm the sound sounds and the led on my desk flashes on. Alacritty seems to not even trigger the alert-bell hook in tmux.
This is on a mac Mojavee, using the latest version of tmux

@silversquirl
Copy link

Interestingly, I came across this issue while using alacritty on Windows and wondering how to disable the audible bell. It's the default notification sound, and I was guessing it was generated by alacritty, but reading this it seems like it's probably coming from elsewhere. I'm using WSL bash. Any suggestions?

@silversquirl
Copy link

Hmm... looks like the bell signal isn't even getting through to alacritty, since visual bell isn't working. It's probably being intercepted by WSL.

@mqudsi
Copy link

mqudsi commented Jan 11, 2019

I definitely don't get any audible bell under WSL.

robertgzr added a commit to robertgzr/alacritty that referenced this issue Apr 10, 2019
Adds a new configuration option under `visual_bell` called
`bell_command` that reuses the command formatting of the keybindings.

This allows for things like playing a notification sound.
See alacritty#1528 (comment)

Closes alacritty#1072
robertgzr added a commit to robertgzr/alacritty that referenced this issue Apr 10, 2019
Adds a new configuration option under `visual_bell` called
`bell_command` that reuses the command formatting of the keybindings.

This allows for things like playing a notification sound.
See alacritty#1528 (comment)

Closes alacritty#1072
robertgzr added a commit to robertgzr/alacritty that referenced this issue Apr 10, 2019
Adds a new configuration option under `visual_bell` called
`bell_command` that reuses the command formatting of the keybindings.

This allows for things like playing a notification sound.
See alacritty#1528 (comment)

Closes alacritty#1528
robertgzr added a commit to robertgzr/alacritty that referenced this issue Jun 29, 2019
Adds a new configuration option under `visual_bell` called
`bell_command` that reuses the command formatting of the keybindings.

This allows for things like playing a notification sound.
See alacritty#1528 (comment)

Closes alacritty#1528
kchibisov added a commit to kchibisov/alacritty that referenced this issue Jun 14, 2020
kchibisov added a commit to kchibisov/alacritty that referenced this issue Jun 14, 2020
kchibisov added a commit to kchibisov/alacritty that referenced this issue Jul 9, 2020
kchibisov added a commit to kchibisov/alacritty that referenced this issue Jul 9, 2020
kchibisov added a commit to kchibisov/alacritty that referenced this issue Jul 9, 2020
kchibisov added a commit that referenced this issue Jul 10, 2020
ambiso pushed a commit to ambiso/alacritty that referenced this issue Jul 21, 2020
@iddm
Copy link

iddm commented Aug 28, 2020

I am not sure this is the rightmost place to ask this, but I want to know if it is possible now to bind a sound to be played whenever user input is requested (for example, whenever a bunch of long-running commands finish and so the user is indicated of that)? Or should it be a shell's feature instead?

@kchibisov
Copy link
Member

Your shell can send \a after command is done (you can set it yourself in shell, it should provide hooks) and if you setup bell command in alacritty you'll get audio bell. if you want audio only in that particular case you can may do that entirely in shell.

@iddm
Copy link

iddm commented Aug 28, 2020

Your shell can send \a after command is done (you can set it yourself in shell, it should provide hooks) and if you setup bell command in alacritty you'll get audio bell. if you want audio only in that particular case you can may do that entirely in shell.

Thanks, I'll try :)

@francescoferraioli
Copy link

This worked for me on MacOS:

bell:
  command:
    program: osascript
    args: ["-e", "beep"]

@NovaViper
Copy link

NovaViper commented Apr 29, 2023

What bell program do we use for ArchLinux in 2023? I can't find the xkbbell package that @Celti mentioned before, it doesn't seem to exist anymore. I can't find any other bell program that I can use. The bell works on every other terminal but this one so I'm just confused.

@Celti
Copy link
Contributor

Celti commented Apr 29, 2023

On Arch, xkbbell is currently in xorg-xkbutils.

Wayland does not have an accepted method of producing a system beep; use a media player app and a sound file.

@NovaViper
Copy link

Thanks! Got it working now

@strafe
Copy link

strafe commented Feb 28, 2024

@francescoferraioli is this solution still working for you?

[bell]
command = { program = "osascript", args = ["-e", "bell"] }

is not working for me currently.

@francescoferraioli
Copy link

@francescoferraioli is this solution still working for you?

[bell]

command = { program = "osascript", args = ["-e", "bell"] }

is not working for me currently.

Sorry, I've changed company since then and am no longer using a Mac so I'm not sure if it still works or not.

@ernestrc
Copy link

@francescoferraioli is this solution still working for you?

[bell]
command = { program = "osascript", args = ["-e", "bell"] }

is not working for me currently.

It should be beep rather than bell (tested on MacOS Ventura 13.4):

[bell]
command = { program = "osascript", args = ["-e", "beep"] }

@strafe
Copy link

strafe commented Mar 13, 2024

It should be beep rather than bell (tested on MacOS Ventura 13.4):

Good spot, thank you! Not sure how I missed that but it's definitely working as expected now 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment