Skip to content

Instantly share code, notes, and snippets.

@tkurtbond
Created December 9, 2023 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkurtbond/a79580b1a8a94e2f1f2c407efa1b0777 to your computer and use it in GitHub Desktop.
Save tkurtbond/a79580b1a8a94e2f1f2c407efa1b0777 to your computer and use it in GitHub Desktop.
Set emacs up to ring the bell using an external program, since the normal beep/bell/ding doesn't seem to work any more.
(defvar tkb-beep-sound "/usr/share/sounds/freedesktop/stereo/bell.oga")
(defvar tkb-beep-program "ogg123")
(defun tkb-bell ()
(interactive)
(start-process "Beep" nil tkb-beep-program
tkb-beep-sound))
(setq ring-bell-function #'tkb-bell)
(unless (file-exists-p tkb-beep-sound)
(yes-or-no-p (format "Error: tkb-beep-sound is set to \"%s\", which does \
not exist!\nUnderstand? "
tkb-beep-sound)))
(let ((path (split-string (getenv "PATH") ":")))
(unless (file-installed-p tkb-beep-program path)
(yes-or-no-p (format "Error: tkb-beep-sound is set to \"%s\", which does \
not exist!\nUnderstand? "
tkb-beep-program))))
@tkurtbond
Copy link
Author

This seems to be a Wayland problem, so a more complete solution would be something like this.

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