This repository has been archived on 2022-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
contrapunctus 958551d498 Address nearly all byte compiler warnings
For the time being, we use a consistent pattern of packages requiring
sexp.el instead of the other way round.

chronometrist-current-task has been moved back to chronometrist-common
2020-05-16 08:35:54 +05:30
doc Address nearly all byte compiler warnings 2020-05-16 08:35:54 +05:30
features point-restore - extend feature 2019-08-05 12:43:05 +05:30
tests Rename chronometrist-sexp -> chronometrist-key-values 2020-05-14 07:32:49 +05:30
.dir-locals.el .dir-locals - add alias, outline-regexp, hide .html and .texi files 2020-05-15 21:33:15 +05:30
.gitignore Update .gitignore 2019-08-05 01:00:36 +05:30
CHANGELOG.md Merge branch 'master' into flexible-timed-alerts 2020-05-03 12:09:14 +05:30
Cask Bump versions 2020-05-03 12:05:42 +05:30
LICENSE licenses - remove CC0 2018-09-25 13:36:04 +05:30
LICENSE.1 licenses - remove CC0 2018-09-25 13:36:04 +05:30
README.md readme - thank aidalgol 2020-05-15 21:34:47 +05:30
TODO.org todo - move optimization to its own section, add todo item 2020-05-15 21:35:49 +05:30
chronometrist-common.el Address nearly all byte compiler warnings 2020-05-16 08:35:54 +05:30
chronometrist-custom.el Address nearly all byte compiler warnings 2020-05-16 08:35:54 +05:30
chronometrist-diary-view.el MELPA - add license information to headers 2020-02-24 01:27:22 +05:30
chronometrist-events.el Address nearly all byte compiler warnings 2020-05-16 08:35:54 +05:30
chronometrist-goals.el chronometrist-goals - suppress byte-compiler warnings 2020-05-15 16:51:39 +05:30
chronometrist-key-values.el append-to-last, tags-add - clarify code 2020-05-15 13:13:31 +05:30
chronometrist-migrate.el MELPA - add license information to headers 2020-02-24 01:27:22 +05:30
chronometrist-plist-pp.el MELPA - add license information to headers 2020-02-24 01:27:22 +05:30
chronometrist-queries.el Move more functions to -sexp 2020-05-14 21:38:43 +05:30
chronometrist-report-custom.el MELPA - add license information to headers 2020-02-24 01:27:22 +05:30
chronometrist-report.el Create sexp-open-log, rename open-file to open-log 2020-05-15 09:02:18 +05:30
chronometrist-sexp.el Address nearly all byte compiler warnings 2020-05-16 08:35:54 +05:30
chronometrist-statistics-custom.el MELPA - add license information to headers 2020-02-24 01:27:22 +05:30
chronometrist-statistics.el statistics - fix incorrect command name 2020-05-15 21:34:17 +05:30
chronometrist-tests.el MELPA - add license information to headers 2020-02-24 01:27:22 +05:30
chronometrist-time.el MELPA - add license information to headers 2020-02-24 01:27:22 +05:30
chronometrist-timer.el Fix recursive load errors and some byte compiler warnings 2020-05-15 15:17:54 +05:30
chronometrist.el Address nearly all byte compiler warnings 2020-05-16 08:35:54 +05:30
scratch-test Add script for testing 2019-04-18 01:41:06 +05:30
test.timelog chronometrist - fix disastrous first-run behaviour 2018-09-20 17:51:58 +05:30
test2.timelog Add tests for Midnight Bug 2 (the clocked-in version) 2018-09-22 01:33:06 +05:30

README.md

chronometrist

A time tracker in Emacs with a nice interface

Largely modelled after the Android application, A Time Tracker

  • Benefits

    1. Extremely simple and efficient to use
    2. Displays useful information about your time usage
    3. Support for both mouse and keyboard
    4. Human errors in tracking are easily fixed by editing a plain text file
    5. Hooks to let you perform arbitrary actions when starting/stopping tasks
  • Limitations

    1. No support (yet) for adding a task without clocking into it.
    2. No support for concurrent tasks.

IMPORTANT: with version v0.3, chronometrist no longer uses timeclock as a dependency and will use its own s-expression-based backend. A command to migrate the timeclock-file, chronometrist-migrate-timelog-file->sexp-file, is provided.

Differences from timeclock

  • 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 a more useful implementation of hooks (see Hooks)

Installation

You can get chronometrist from https://framagit.org/contrapunctus/chronometrist/

chronometrist requires dash.el

Add the Chronometrist directory to your load-path, and (require 'chronometrist).

Commands

chronometrist

Run M-x chronometrist to see your projects, the time you spent on them today, which one is active, and the total time clocked today.

Hit RET on a project to clock in for it. If it's already clocked in, it will be clocked out, and you'll be prompted for an optional reason. Use M-RET if you don't want to be asked for a reason.

Whenever you call chronometrist, the cursor will helpfully be placed on the last activity you clocked out of, or the current activity clocked in.

Alternatively, 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.

Press l to view your chronometrist-file (~/.emacs.d/chronometrist.sexp by default). Press r to see a weekly report (see chronometrist-report)

Running M-x chronometrist when the Chronometrist buffer is visible will kill it, so the key you bind it to can function as a toggle.

chronometrist keeps itself updated via an idle timer - no need to frequently press g to update.

Attaching key values to time intervals (experimental)

Add chronometrist-kv-read to chronometrist-before-in-functions and/or chronometrist-before-out-functions, as you like (see Hooks).

You will now be prompted to enter key-values when you clock in/out. Leave an entry blank to exit the prompt, edit the resulting key-values by hand if required, then press C-c C-c to accept the key-values (or C-c C-k to cancel).

chronometrist-report

Run M-x chronometrist-report (or chronometrist with a prefix argument of 1, or press r in the chronometrist buffer) to see a weekly report.

Press b to look at past weeks, and f for future weeks.

Press l to view your chronometrist-file, ~/.emacs.d/chronometrist.sexp by default.

Just like chronometrist, chronometrist-report will also toggle the visibilty of the buffer.

chronometrist-report keeps itself updated via an idle timer - no pressing g to update.

chronometrist-statistics

Run M-x chronometrist-statistics (or chronometrist with a prefix argument of 2) to view statistics.

Press b to look at past time ranges, and f for future ones.

Press l to view your chronometrist-file, ~/.emacs.d/chronometrist.sexp by default.

Just like chronometrist, chronometrist-statistics will also toggle the visibilty of the buffer.

Customization

See the Customize groups chronometrist and chronometrist-report for variables intended to be user-customizable.

Hooks

Chronometrist currently has four hooks -

  1. chronometrist-before-in-functions
  2. chronometrist-after-in-functions
  3. chronometrist-before-out-functions
  4. chronometrist-after-out-functions

As their names suggest, these are 'abnormal' hooks, i.e. the functions they contain must accept arguments. In this case, each function must accept exactly one argument, which is the project which is being started or stopped.

As an example from the author's own init -

(defun my-start-guitar (project)
  (when (equal project "Guitar")
    (find-file-other-window "~/repertoire.org")))

(add-hook 'chronometrist-before-in-functions 'my-start-guitar)

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 ()
  (if (magit-anything-modified-p)
      (if (yes-or-no-p "You have uncommitted changes. Really clock out? ")
          t
        (magit-status)
        nil)
        t))

(add-hook 'chronometrist-before-out-functions 'my-commit-prompt)

Adding more information

Since v0.3, Chronometrist supports adding additional information to tracked time, in the form of tags and user-defined key-value pairs.

Tags

Tags can be added using the chronometrist-tags-add function. It can currently be added to any hooks except chronometrist-before-in-functions.

Key-value pairs

Key-value pairs can be added using the chronometrist-kv-add function. It can currently be added to any hooks except chronometrist-before-in-functions. Keys can be any string except "name", "tags", "start", or "end". Values can be any readable Lisp values.

Prompt when exiting Emacs

If you wish to be prompted when you exit Emacs while tracking time, you can use this -

(add-hook 'kill-emacs-query-functions 'chronometrist-query-stop)

Roadmap/Ideas

  • Show details for time spent on a project when clicking on a non-zero "time spent" field (in both Chronometrist and Chronometrist-Report buffers).

chronometrist

  1. Better shortcuts - shortcuts derived from the first alphabet of each project might be nicer.
  2. Use make-thread in v26 or the emacs-async library for chronometrist-entries/chronometrist-report-entries
  3. Some way to update buffers every second without making Emacs unusable. (impossible?)
  4. "Day summary" - for users who use the "reason" feature to note the specifics of their actual work. Combine the reasons together to create a descriptive overview of the work done in the day.

Chronometrist-report

  1. Show week counter and max weeks; don't scroll past first/last weeks
  2. Highlight column of current day
  3. Add support for other locale weeks/weekday names
  4. Show only certain projects

chronometrist-statistics

  1. Show range counter and max ranges; don't scroll past first/last time ranges
  2. activity-specific - average time spent in $TIMEPERIOD, average days worked on in $TIMEPERIOD, current/longest/last streak, % of $TIMEPERIOD, % of active (tracked) time in $TIMEPERIOD, ...
  3. general - most productive $TIMEPERIOD, GitHub-style work heatmap calendar, ...
  4. press 1 for weekly stats, 2 for monthly, 3 for yearly

Miscellaneous

  1. README - add images
  2. [-] Create test timelog file and UI behaviour tests
  3. Use for chronometrist-report-weekday-number-alist whatever variables like initial-frame-alist use to get that fancy Custom UI for alists.
  4. Multi-timelog-file support?
  5. inflatable raptor

Contributions and contact

Feedback and MRs very welcome. 🙂 doc/hacking.md contains an introduction to the codebase.

Contact the creator and other Emacs users in the Emacs room on the Jabber network - xmpp:emacs@salas.suchat.org?join (web chat)

(For help in getting started with Jabber, click here)

License

Chronometrist is released under your choice of Unlicense and the WTFPL.

(See files LICENSE and LICENSE.1).

Thanks

wasamasa, bpalmer, aidalgol, 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 for testing and bug reports