From 15a506380edb4a2739edc2c816ac0786d89314fd Mon Sep 17 00:00:00 2001 From: Max Schlueter Date: Thu, 15 Sep 2022 23:15:58 +0200 Subject: [PATCH] Show currently clocked time as well --- config.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config.el b/config.el index b5623d5..5500819 100644 --- a/config.el +++ b/config.el @@ -510,13 +510,18 @@ the inbox. Refile to any org-gtd incubate target (see manual)." "Form a clock string that will be shown in polybar." (require 'org-clock) (when (org-clocking-p) - (let ((clocked-time (org-clock-get-clocked-time))) + (let ((currently-clocked-time + (floor (org-time-convert-to-integer + (time-since org-clock-start-time)) + 60)) + (clocked-time (org-clock-get-clocked-time))) (if org-clock-effort (let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort)) + (current-work-done-str (org-duration-from-minutes currently-clocked-time)) (work-done-str (org-duration-from-minutes clocked-time)) (effort-str (org-duration-from-minutes effort-in-minutes))) - (format "%s/%s %s" - work-done-str effort-str org-clock-heading)) + (format "%s (%s/%s) %s" + current-work-done-str work-done-str effort-str org-clock-heading)) (format "%s %s" (org-duration-from-minutes clocked-time) org-clock-heading)))))