From 83477573a1dd63cf24b2b3bf9d2890bb49945bb0 Mon Sep 17 00:00:00 2001
From: coolneng <akasroua@gmail.com>
Date: Tue, 12 Apr 2022 20:25:18 +0200
Subject: [PATCH] Add a function that returns the pomodoro state

---
 +org.el | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/+org.el b/+org.el
index fee0ae4..66cbd1c 100644
--- a/+org.el
+++ b/+org.el
@@ -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)))
+      "")))