This is the setup I use for tracking time using the Pomodoro method. It requires org version >= 8.1.2.
I set the variables org-pomodoro-clock-out-sound and org-pomodoro-clock-in-sound to string file paths to “.au” files (Sun/NeXT audio data). In the org file where I am tracking my break time, I have the target “#<<pomodoro-break>>”. In the heading that I am timing, I set the property POMODORO to t. When I want to clock out of the pomodoro break, I simply clock into the task that I want to track.
(setq org-pomodoro-clock-out-sound "/home/devin/media/tones/chime.au" org-pomodoro-clock-in-sound "/home/devin/media/tones/chime2.au" org-pomodoro-break-file "/home/devin/datebook_PIM/datebook.org" org-pomodoro-break-target "pomodoro-break")
If you do not specify a value for `org-pomodoro-break-file’, then a file in /tmp will be created. There is probably a better way to do this.
Finding the CLOCK time is done by searching the buffer with a regular expression.
`org-pomodoro-break’ is within the local variable scope of `org-clock-out’ when ran as a hook. The variable h that holds the hours gets overwritten, as does the total time in seconds. The variables `te’ and `ts’ could be used to recompute the time spent, but this would rely on those local variables not changing in the future.
According to the spec, the clock entries should follow this format:
CLOCK: TIMESTAMP DURATION
[DATE TIME REPEATER]--[DATE TIME REPEATER]
“DAYNAME can contain any non-whitespace character besides +, -, ], >, a digit or \n.”
repeater is not used