A hook to add started task in taskwarrior to jrnl
Project description
taskwarrior_jrnl_hook
Taskwarrior allow annotation of tasks, but I find it less practical than using jrnl to do so. This hook bring together both of this great tools.
This script was inspirated by taskwarrior-time-tracking-hook
Principal
Starting a task will automatically pass its description to jrnl. If started task have tags they will be added into the title with corresponding symbol in jrnl (by default, jrnl tags are mark with "@").
$ task list
ID Tags Due Description
1 administration perso 2018-09-21 Pay electricity bill
$ task 1 start
That action will call the hook and run jrnl as a subprocess.
jrnl "Pay electricity bill @administration @perso"
Now, if you look in your jrnl you should see task description added as title with tags from taskwarrior.
jrnl -1
2018-09-21 9h35 Pay electricity bill @administration @perso
Install
pip install taskwarrior-jrnl-hook
Then add the hook to .task/hook folder
mkdir -p ~/.task/hooks
ln -s ~/.local/bin/taskwarrior_jrnl_hook ~/.task/hooks/on-modify.jrnl
Configuration
By default this hook will look config info in your ~/.taskrc config file. Default options are built in the hook, if you want to change hook behavior put options entry in your taskwarrior config file.
Options :
jrnl name
Name | Default | Description |
---|---|---|
jrnl_name |
default | jnrl name to call |
If specify, this hook will use the jrnl name defined in the config, otherwise it will use default
as jrnl name.
Personally I write a journal for each month, so I added an option to get month name from started task and use it as jrnl name.
Name | Default | Description |
---|---|---|
jrnl_by_month |
False | Use month as jrnl name |
language |
en | month's language to output |
If set to True
hook script will call jrnl for the given month. You can specify language in order to get the right spelling for the month. Month is written in all letters with no capital.
jrnl configuration
Name | Default | Description |
---|---|---|
jrnl_config |
~/.jrnl_config |
Path to your jrnl configuration |
In order to use correct tags symbol used in your jrnl, the script need to read your jrnl's configuration.
tags
Name | Default | Description |
---|---|---|
jrnl_tags |
True | Add tags to jrnl |
This option allow you to add taskwarrior tags to your jrnl's title.
project
Name | Default | Description |
---|---|---|
add_project |
True | Add project to jrnl |
This option add project name under your title in the body.
filter
Name | Default | Description |
---|---|---|
filter_tags |
None | Tasks to be excluded by tags |
This option allow you to exclude by tags tasks that you don't want to see in your jrnl.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for taskwarrior_jrnl_hook-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e10a0ec8c359afbb13d2ff7fe85fad5ec6ae01a436eef2ce2e53de7ee04a49bd |
|
MD5 | a72f73c33bd63966ad707ad9d2d3990c |
|
BLAKE2b-256 | 6f71df57b9f7c039b2a70f17d84edd547799d96dfba572eb368987030ef6cd28 |
Hashes for taskwarrior_jrnl_hook-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9846509b60c8541f3299448d30ca6ddb89ebcb0cf253f9048114899e2b34700 |
|
MD5 | ccd37b2d832fbe77fe5993d641df14ed |
|
BLAKE2b-256 | 5895a75ee5d60f364d18957817fa353b173b08908aef0ab865e8c34ffd124947 |