Sai Karthik

Balancing the braces ...

A simple Pomodoro timer in Elisp

December 2, 2023 | 1 minute read

This is a simple Pomodoro timer which i wrote some time ago in elisp while using doom emacs!

The code is based on systemcrafters pomodoro example. I have customized it a bit more to support pause & resume! 😁

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
;; Based on https://systemcrafters.cc/emacs-shorts/pomodoro-timer/
(defun my/pomodoro-timer ()
  "A simple pomodoro timer set for 30 min. If timer is running, Calling this function will pause/resume it"
  (interactive)
  ;; pause / resume if timer is running
  (if (not (equal (org-timer-value-string) "0:00:01 "))
      (org-timer-pause-or-continue)
  ;; supported sound formats: https://www.gnu.org/software/emacs/manual/html_node/elisp/Sound-Output.html
    (setq! org-clock-sound  (concat doom-private-dir "attention.wav"))
    (org-timer-set-timer 30) ;; 30 minutes
    )
)
Comment | Share