https://github.com/aceofspades5757/tw-hook-elapsed
Taskwarrior hook to add an `elapsed` UDA field, and to persist `start` field.
https://github.com/aceofspades5757/tw-hook-elapsed
elapsed hook hooks rust task-management taskwarrior time-management
Last synced: 7 months ago
JSON representation
Taskwarrior hook to add an `elapsed` UDA field, and to persist `start` field.
- Host: GitHub
- URL: https://github.com/aceofspades5757/tw-hook-elapsed
- Owner: AceofSpades5757
- Created: 2023-04-26T19:11:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-26T21:48:20.000Z (over 1 year ago)
- Last Synced: 2025-03-15T23:53:16.463Z (7 months ago)
- Topics: elapsed, hook, hooks, rust, task-management, taskwarrior, time-management
- Language: Rust
- Homepage:
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Description
_Adding existing time has been disabled._
Taskwarrior hooks to add the UDA elapsed on new tasks and modified tasks, anything with a start and end value. This is useful for tracking time spent on tasks.
It also helps preserve the start and end time of a task, which is removed by Taskwarrior when an end time is added.
This hook is **not** good for tracking time spent on tasks that you toggle on and off and will break any other hooks that are designed to do this.
This hook **is** good for tracking time spent on tasks that you explicilty start and finish and you'd like to keep that information. I use this to track my shifts at work.
~~Elapsed is calculated by `existing_time + (end_date - start_date)`.~~
Elapsed is calculated by `end_date - start_date`.
# Installation
_Note that there are a couple noop (no operation) hooks that are included as well. They'll be removed in due time._
Requires that the Rust toolchain be installed. If you need a release, create an issue and I'll start making releases.
## Using [`just`](https://github.com/casey/just)
_Need to have [`just`](https://github.com/casey/just) installed._
`just install`
This will put `on-add_elapsed` and `on-modify_elapsed` binaries in `~/.task/hooks`.
## Manually
1. Create installation binary in a local build directory: `cargo install --root ./build --path .`
1. Copy the binaries to your hooks directory (by default in `~/.task/hooks`): `cp ./build/bin/* ~/.task/hooks/`# Scenarios
Adding/Logging a Task:
* If task has a start and end date: Add elapsed time
* If task is missing a start or end date: Do nothingModifying a Task:
* If task has a start and end date: Add elapsed time ~~to existing time~~
* If task is missing a start or end date: Do nothing