Skip to content

Group entries in a org-mode clocktable by their CATEGORY property.

Notifications You must be signed in to change notification settings

cashpw/clocktable-by-category

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

clocktable-by-category

Group clocktable entries by their CATEGORY property.

#+BEGIN: clocktable-by-category :files-fn your/function-that-returns-list-of-files :block "2023-11-13" :maxlevel 5 :mrege-duplicate-headlines
|          |                                           |      <r> |      |
| Category | Headline                                  | Time (h) |      |
|----------+-------------------------------------------+----------+------|
|          | All *Total time*                          |   *4:13* |      |
|----------+-------------------------------------------+----------+------|
| Finance  | *Category time*                           |   *0:07* |      |
|          | Confirm mortgage payment went through     |          | 0:03 |
|          | Confirm credit card payments went through |          | 0:04 |
|----------+-------------------------------------------+----------+------|
| Health   | *Category time*                           |   *1:42* |      |
|          | Stretch                                   |          | 0:30 |
|          | Brush teeth (morning)                     |          | 0:03 |
|          | Shoulders                                 |          | 1:09 |
|----------+-------------------------------------------+----------+------|
| Study    | *Category time*                           |   *0:23* |      |
|          | Flashcards                                |          | 0:23 |
|----------+-------------------------------------------+----------+------|
| nil      | *Category time*                           |   *0:48* |      |
|          | Personal email                            |          | 0:01 |
|          | Walk (evening)                            |          | 0:47 |
#+END:

Thanks to ffevotte for setting the foundation.

Also check out =clocktable-by-tag=.

Install

Doom Emacs

#+begin_src emacs-lisp :tangle packages.el
(package! clocktable-by-category
  :recipe (:host github
           :repo "cashpw/clocktable-by-category"))
#+end_src

#+begin_src emacs-lisp :tangle config.el
(use-package! clocktable-by-category
  :after org)
#+end_src

Vanilla Emacs

TODO

Properties

:files

A literal list, or variable, of files to read. This replaces :scope.

:files-fn

A function which returns a list of files to read. This replaces :scope.

For example, to replicate :scope agenda-with-archives:

(defun your/agenda-with-archives ()
  "Return agenda files plus archives."
  (org-agenda-files t t))
#+BEGIN: clocktable-by-category :files-fn your/agenda-with-archives
#+END:

:merge-duplicate-headlines (Optional)

Merge duplicate headlines when non-nil.

#+BEGIN: clocktable-by-category :block "2023-11-27" ...
#+CAPTION: Clock summary at [2023-11-27 Mon 19:45], for Monday, November 27, 2023.
|          |                  |    <r> |      |
| Category | Headline         |   Time |      |
|----------+------------------+--------+------|
|          | All *Total time* | *1:00* |      |
|----------+------------------+--------+------|
| home     | *Category time*  | *1:00* |      |
|          | Laundry          |        | 0:20 |
|          | Laundry          |        | 0:20 |
|          | Laundry          |        | 0:20 |
#+END:
#+BEGIN: clocktable-by-category :block "2023-11-27" merge-duplicate-headlines t ...
#+CAPTION: Clock summary at [2023-11-27 Mon 19:45], for Monday, November 27, 2023.
|          |                  |    <r> |      |
| Category | Headline         |   Time |      |
|----------+------------------+--------+------|
|          | All *Total time* | *1:00* |      |
|----------+------------------+--------+------|
| home     | *Category time*  | *1:00* |      |
|          | Laundry          |        | 1:00 |
#+END:

About

Group entries in a org-mode clocktable by their CATEGORY property.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published