Add a function that returns the pomodoro state

This commit is contained in:
coolneng 2022-04-12 20:25:18 +02:00
parent fc2ebefa68
commit 83477573a1
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 16 additions and 0 deletions

16
+org.el
View File

@ -91,3 +91,19 @@
:empty-lines 1)))
;; Fix org-chef scraping
(setq org-chef-prefer-json-ld t)
;; Get the current state of org-pomodoro
(defun bergheim/org-clock-status ()
"Return the org time status - including any pomodoro activity"
(if (and (featurep 'org-pomodoro) (org-pomodoro-active-p))
(cl-case org-pomodoro-state
(:pomodoro
(format "%d min" (/ (org-pomodoro-remaining-seconds) 60)))
(:short-break
(format "Short break: %d min" (/ (org-pomodoro-remaining-seconds) 60)))
(:long-break
(format "Long break: %d min" (/ (org-pomodoro-remaining-seconds) 60)))
(:overtime
(format "Overtime! %d min" (/ (org-pomodoro-remaining-seconds) 60))))
(if (org-clocking-p)
(format "%s" (org-duration-from-minutes (org-clock-get-clocked-time)))
"")))