||2 weeks ago|
|doc||2 months ago|
|elisp||3 weeks ago|
|features||1 year ago|
|tests||5 months ago|
|.dir-locals.el||3 weeks ago|
|.gitignore||2 years ago|
|CHANGELOG.md||3 weeks ago|
|Cask||3 weeks ago|
|README.md||2 weeks ago|
|TODO.org||3 weeks ago|
|UNLICENSE||1 year ago|
|WTFPL||1 year ago|
|manual.md||2 weeks ago|
|manual.org||2 weeks ago|
|org-doom-molokai.css||2 months ago|
Table of Contents
- How to display a prompt when exiting with an active task
- How to load the program using literate-elisp
- How to attach tags to time intervals
- How to attach key-values to time intervals
- How to skip running hooks/attaching tags and key values
- How to open certain files when you start a task
- How to warn yourself about uncommitted changes
- How to display the current time interval in the activity indicator
- User's reference
- Contributions and contact
A time tracker in Emacs with a nice interface
Largely modelled after the Android application, A Time Tracker
- Extremely simple and efficient to use
- Displays useful information about your time usage
- Support for both mouse and keyboard
- Human errors in tracking are easily fixed by editing a plain text file
- Hooks to let you perform arbitrary actions when starting/stopping tasks
- Fancy graphs with chronometrist-sparkline extension
- No support (yet) for adding a task without clocking into it.
- No support for concurrent tasks.
Compared to timeclock.el, Chronometrist
- stores data in an s-expression format rather than a line-based one
- supports attaching tags and arbitrary key-values to time intervals
- has commands to shows useful summaries
- has more hooks
Org time tracking
Chronometrist and Org time tracking seem to be equivalent in terms of capabilities, approaching the same ends through different means.
- Chronometrist doesn't have a mode line indicator at the moment. (planned)
- Chronometrist doesn't have Org's sophisticated querying facilities. (an SQLite backend is planned)
- Org does so many things that keybindings seem to necessarily get longer. Chronometrist has far fewer commands than Org, so most of the keybindings are single keys, without modifiers.
- Chronometrist's UI makes keybindings discoverable - they are displayed in the buffers themselves.
- Chronometrist's UI is cleaner, since the storage is separate from the display. It doesn't show tasks as trees like Org, but it uses tags and key-values to achieve that. Additionally, navigating a flat list takes fewer user operations than navigating a tree.
- Chronometrist data is just s-expressions (plists), and may be easier to parse than a complex text format with numerous use-cases.
Set up MELPA - https://melpa.org/#/getting-started
(Chronometrist uses Semantic Versioning and the developer is accident-prone, so using MELPA Stable is suggested 😏)
M-x package-install RET chronometrist RET
You can get
chronometrist from https://tildegit.org/contrapunctus/chronometrist
Add the "elisp/" subdirectory to your load-path, and
M-x chronometrist to see your projects, the time you spent on them today, which one is active, and the total time clocked today.
Click or hit
chronometrist-toggle-task) on a project to start tracking time for it. If it's already clocked in, it will be clocked out.
You can also hit
<numeric prefix> RET anywhere in the buffer to toggle the corresponding project, e.g. =C-1 RET= will toggle the project with index 1.
r to see a weekly report (see
M-x chronometrist-report (or
chronometrist with a prefix argument of 1, or press
r in the
chronometrist buffer) to see a weekly report.
b to look at past weeks, and
f for future weeks.
M-x chronometrist-statistics (or
chronometrist with a prefix argument of 2) to view statistics.
b to look at past time ranges, and
f for future ones.
In the buffers created by the previous three commands, you can press
chronometrist-open-log) to view/edit your
chronometrist-file, which by default is
All of these commands will kill their buffer when run again with the buffer visible, so the keys you bind them to behave as a toggle.
All buffers keep themselves updated via an idle timer - no need to frequently press
g to update.
If you wish you could define time goals for some tasks, and have Chronometrist notify you when you're approaching the goal, completing it, or exceeding it, check out the extension chronometrist-goal.el.
See the Customize groups
chronometrist-report for variables intended to be user-customizable.
How to display a prompt when exiting with an active task
Evaluate or add to your init.el the following -
(add-hook 'kill-emacs-query-functions 'chronometrist-query-stop)
How to load the program using literate-elisp
(add-to-list 'load-path "<directory containing chronometrist.org>") (require 'literate-elisp) ;; or autoload, use-package, ... (literate-elisp-load "chronometrist.org")
How to attach tags to time intervals
chronometrist-tags-addto one or more of these hooks 1 -
(add-to-list 'chronometrist-after-in-functions 'chronometrist-tags-add) (add-to-list 'chronometrist-before-out-functions 'chronometrist-tags-add) (add-to-list 'chronometrist-after-out-functions 'chronometrist-tags-add)
clock in/clock out to trigger the hook.
The prompt suggests past combinations you used for the current task, which you can browse with
M-p=/=M-n. You can leave it blank by pressing
How to attach key-values to time intervals
chronometrist-kv-addto one or more of these hooks 2 -
(add-to-list 'chronometrist-after-in-functions 'chronometrist-kv-add) (add-to-list 'chronometrist-before-out-functions 'chronometrist-kv-add) (add-to-list 'chronometrist-after-out-functions 'chronometrist-kv-add)
To exit the prompt, press the key it indicates for quitting - you can then edit the resulting key-values by hand if required. Press
C-c C-c to accept the key-values, or
C-c C-k to cancel.
How to skip running hooks/attaching tags and key values
chronometrist-toggle-task-no-hooks) to clock in/out.
How to open certain files when you start a task
An idea from the author's own init -
(defun my-start-project (project) (pcase project ("Guitar" (find-file-other-window "~/repertoire.org")) ;; ... )) (add-hook 'chronometrist-before-in-functions 'my-start-project)
How to warn yourself about uncommitted changes
Another one, prompting the user if they have uncommitted changes in a git repository (assuming they use Magit) -
(autoload 'magit-anything-modified-p "magit") (defun my-commit-prompt () "Prompt user if `default-directory' is a dirty Git repository. Return t if the user answers yes, if the repository is clean, or if there is no Git repository. Return nil (and run `magit-status') if the user answers no." (cond ((not (magit-anything-modified-p)) t) ((yes-or-no-p (format "You have uncommitted changes in %S. Really clock out? " default-directory)) t) (t (magit-status) nil))) (add-hook 'chronometrist-before-out-functions 'my-commit-prompt)
How to display the current time interval in the activity indicator
(defun my-activity-indicator () (thread-last (plist-put (chronometrist-last) :stop (chronometrist-format-time-iso8601)) list chronometrist-events-to-durations (-reduce #'+) truncate chronometrist-format-time)) (setq chronometrist-activity-indicator #'my-activity-indicator)
Chronometrist is a literate program, made using Org - the canonical source is the
chronometrist.org file, which contains source blocks. These are provided to users after tangling (extracting the source into an Emacs Lisp file).
The Org file can also be loaded directly using the literate-elisp package, so that all source links (e.g.
describe-function) lead to the Org file, within the context of the concerned documentation. See How to load the program using literate-elisp.
chronometrist.org is also included in MELPA installs, although not used directly by default, since doing so would interfere with automatic generation of autoloads.
All variables intended for user customization are listed here. They serve as the public API for this project for the purpose of semantic versioning. Any changes to these which require a user to modify their configuration are considered breaking changes.
Contributions and contact
Feedback and MRs are very welcome. 🙂
- <TODO.md> has a long list of tasks
- <doc/manual.md> contains an overview of the codebase, explains various mechanisms and decisions, and has a reference of definitions.
If you have tried using Chronometrist, I'd love to hear your experiences! Get in touch with the author and other Emacs users in the Emacs channel on the Jabber network - xmpp:email@example.com?join (web chat)
(For help in getting started with Jabber, click here)
I dream of a world where all software is liberated - transparent, trustable, and accessible for anyone to use or improve. But I don't want to make demands or threats (e.g. via legal conditions) to get there.
I'd rather make a request - please do everything you can to help that dream come true. Please Unlicense as much software as you can.
(See files and ).
wasamasa, bpalmer, aidalgol, pjb and the rest of #emacs for their tireless help and support
jwiegley for timeclock.el, which we used as a backend in earlier versions
blandest for helping me with the name
fiete and wu-lee for testing and bug reports
1 but not
2 but not