From 4da58271ca6713ba07e35d49b595c43b473a050d Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Sun, 19 Oct 2025 13:24:47 +0100 Subject: Add custom clock sound & enable playing sounds with ffplay --- emacs-config.org | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/emacs-config.org b/emacs-config.org index ae690d2..0ef91f2 100644 --- a/emacs-config.org +++ b/emacs-config.org @@ -1160,7 +1160,24 @@ Command to review the weekend. org-agenda-custom-commands) #+end_src -*** Org Clock-table +*** Org Clock +Play org-clock sounds with ~ffplay~ if possible. +Requires =oxygen-sounds= system package. +#+begin_src elisp + (with-eval-after-load 'org-clock + (advice-add 'org-clock-play-sound :around + (lambda (cmd sound) + "Play sound with ffplay if available." + (if (file-exists-p sound) + (if (executable-find "ffplay") + (start-process "ffplay" nil + "ffplay" "-nodisp" "-autoexit" "-v" "-8" sound) + (apply cmd sound)) + (warn "Could not play file '%s'" sound)))) + (setq-default + org-clock-sound "/usr/share/sounds/oxygen/stereo/completion-success.ogg")) +#+end_src + Define a custom clocktable formatter function for ~+org-clocktable-format~. #+begin_src elisp (with-eval-after-load 'org-clock -- cgit