Created
December 9, 2023 23:39
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems to be a Wayland problem, so a more complete solution would be something like this.