2

I use org-mode for time tracking and can calculate the overall time with C-c C-x d. Is there a good way to show total time spent over several org-mode files (I tend to have separate projects in separate files)?

2

In the agenda, hit R to add a "clock report" at the bottom, which summarises time spent on tasks by the org file they're in, as well as shows the total time.

2

You can create a custom agenda command to assemble arbitrary tasks from various files.

You then have a couple of ways of showing the clocking information:

  1. A custom org-agenda-prefix-format
  2. Switching to column-view and using a format something like:

    (setq org-columns-default-format
          "%TODO %70ITEM(Task) %8Effort(Effort){:} %8CLOCKSUM{:} %8CLOCKSUM_T(Today){:} %CLOSED")
    
1

Along with the Agenda's clockreport, you can drop inline clocktables in to your Org files, which is nice if you're looking for something more static than what an Agenda will generate.

1

As @Ryan says, what you want is a clock table. The key is that the clock table can include several files. For example:

#+BEGIN: clocktable :maxlevel 4 :scope ("todo.org""journal.org") :block today
#+END:

If you C-c C-c on that line, it'll generate a clocktable that sums time spent across the files "todo.org" and "journal.org". Use :maxlevel to specify how detailed you want the output to be (summarized at the top level of each file? summaries for each headline? Summaries for each headline at depth 2? Etc.). But you'll get a total summed across all files at the top regardless.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.