Skip to content

A Taskwarrior hook that logs task start/stop times to a file that (h)ledger can read

License

Notifications You must be signed in to change notification settings

linuxcaffe/task-timelog-hook

Repository files navigation

task-timelog-hook

A taskwarrior hook that logs task start/stop times to a timeclock file, that ledger and hledger can read.

  • TLDR; If you enjoy the command-line and you want to track your time, including taskwarrior start/stop times, projects and tags, and you want to be able to easily read/ report/ query/ export your time-accounting data, then you should give this project a try. This approach is an alternative to timewarrior.
  • Warning: experimenting with ledger and/or hledger can lead to vastly improved personal financial and time accounting!

INTRODUCTION

  • Taskwarrior is a command-line task-management program that is amazingly customizable, with projects and tags and reports and User Defined Attributes.. it's "the 800lb gorilla" in the CLI ToDo list jungle. Tasks can be started and stopped, and those times recorded as annotations, but taskwarrior doesn't have the built-in functionality to track or report on the those intervals. That's where ledger and hledger shine!

  • ledger and hledger are both mature command-line accounting programs with active development communities. They are work-alikes, and while not identical (ledger written in c++, hledger in haskell) they share most file-formats and many commands. One of the things they have in common is the ability to query and report from timeclock (a.k.a. timelog) formatted text files. The terms "timeclock" and "timelog" seem to be used interchangeably, and that's fine as long as the file extension is "*.timeclock".

INSTALL

Requirements

  • Taskwarrior
  • Taskwarrior hook
  • ledger or hledger

CONFIGURE

  • files location
  • editor

RECOMMENDED

  • t "t" is a handy bash script that works great with timelog files. It simplifies starting/ stopping/ switching/ reporting timelog functions with just a few keystrokes.

  • timedot (for hledger users) timedot is another timelogging file format for those things you want to record approximately how much time per-day you spent doing various things. It's concise and human-readable, and ideal for those activities that dont require CLOCK-IN/ CLOCK-OUT precision. If you use hledger, timedot and timeclock records can easily be combined by including them both from a journal file.

USAGE

With this hook installed, timelog (eg. task.timeclock file) entries are automatically created with taskwarrior start/stop commands. Because the timecklock file is simple and human-readable text, it's easily modified in your $EDITOR of choice. A great variety of report and options can be run using ledger (man ledger) or hledger (hledger<CR>). Working with timeclock (timelog) files is even easier using "t".

CREDITS

This hook is based entirely on https://gist.github.com/wbsch/d977b0ac29aa1dfa4437 by Wilhelm Schürmann in 2015, and it works just great! I'm expanding the gist to a github repo to provide documentation and tweaks where needed.

CONTRIBUTIONS

Bug reports, suggestions, pull requests welcome https://github.com/linuxcaffe/task-timelog-hook/issues

About

A Taskwarrior hook that logs task start/stop times to a file that (h)ledger can read

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages