Created
January 21, 2024 20:20
-
-
Save tkurtbond/bf7c6bc08b4d0758401b794f6b848b4b to your computer and use it in GitHub Desktop.
Set emacs up to ring the bell using an external program under Wayland, since the Wayland devs have something against the traditional bell supplied by Xbell.
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
(when (getenv "WAYLAND_DISPLAY") | |
(message "Running under Wayland") | |
(defvar tkb-beep-sound "/usr/share/sounds/freedesktop/stereo/bell.oga") | |
(defvar tkb-beep-program "ogg123") | |
(defun tkb-bell () | |
"Ring the 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-program is set to \"%s\", which does \ | |
not exist!\nInstall vorbis-tools! Understand? " | |
tkb-beep-program))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment