marcinkoziej/org-pomodoro

Number of pomodoros/day

thaaophz opened this issue · 4 comments

Hi,
thanks for this great tool, I use it every day!
Do you have any idea how to count (automatically) the number of pomodoros made throughout the day?

leoc commented

Hi, glad to hear you like it!

I think counting could be done in two ways.
One way would be calculating the time tracked for the day and estimating the number from that.
Another way would be to count actually finished pomodoros for the day by org-pomodoro itself.

I think the latter approach would be better, since it it would take interrupted pomodoros into account, but it would need extra development of a data structure that holds the pomodoro information.
We could track a finished pomodoro in the org-mode logbook, but currently I do not know how well that plays with other org-mode packages.

If it does not pose any problems we could track finished pomodoros in a pomodoro finished hook and have a function that scans the org-mode file for those trackings, like the org-clock commands scan the files for clocked time.

Thanks for your reply.

After some more research I found org-agenda-clockreport-mode (v R in the agenda-view), which looks almost what I was looking for.
There is no infomation about pomodoros but a good summary about where the time was spent on the day.
If you have an idea about how to include the number of pomodoros in the clockreport it would be fantastic, otherwise I think thats's good, too.

To ignore "empty files" I add:

(setq org-agenda-clockreport-parameter-plist
 (quote (:fileskip0 t and :stepskip0 t)))
| File         | Headline                            | Time   |      |
|--------------+-------------------------------------+--------+------|
|              | ALL *Total time*                    | *0:47* |      |
|--------------+-------------------------------------+--------+------|
| gtd.org      | *File time*                         | *0:47* |      |
|              | Spielwiese                          | 0:47   |      |
|              | \emsp clocktest                     |        | 0:47 |
|--------------+-------------------------------------+--------+------|

And to replace "\emsp" (code found here):

(defun my-org-clocktable-indent-string (level)
  (if (= level 1)
      ""
    (let ((str "^"))
      (while (> level 2)
        (setq level (1- level)
              str (concat str "--")))
      (concat str "-> "))))

(advice-add 'org-clocktable-indent-string :override #'my-org-clocktable-indent-string)

So that the clock-report looks like this:

| File         | Headline                          | Time   |      |
|--------------+-----------------------------------+--------+------|
|              | ALL *Total time*                  | *0:47* |      |
|--------------+-----------------------------------+--------+------|
| gtd.org      | *File time*                       | *0:47* |      |
|              | Spielwiese                        | 0:47   |      |
|              | ^-> clocktest                     |        | 0:47 |
|--------------+-----------------------------------+--------+------|

Soory, haven't seen #35 befor. This is exactly what I was looking for.

leoc commented

Perfect! That stack exchange issue totally slipped by me.