Skip to main content

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 :

  1. jrnl name
  2. jrnl configuration
  3. tags
  4. project
  5. filter

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

taskwarrior_jrnl_hook-0.1.5.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taskwarrior_jrnl_hook-0.1.5-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file taskwarrior_jrnl_hook-0.1.5.tar.gz.

File metadata

  • Download URL: taskwarrior_jrnl_hook-0.1.5.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for taskwarrior_jrnl_hook-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4448ffed2147ca33c1279e4b9b4bbdf13cd3bd4d43ff286c4df24f5239f55611
MD5 bde40a043c437d921a1b2779444dc482
BLAKE2b-256 acfca27f40433c7e03fa0b3ae0accb2f9ef280bfaf5c0bf10118be6238e92657

See more details on using hashes here.

File details

Details for the file taskwarrior_jrnl_hook-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: taskwarrior_jrnl_hook-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for taskwarrior_jrnl_hook-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4e7ccd0cfdf80fecaee16b8a9459d96ccb6387a99eb87550a8e76707800a6b10
MD5 772ed28da8441b11bfa81878a4e8b8ba
BLAKE2b-256 beef94217e7aab899305869c6c521d1715151dafe43a69442fc977cfb7faf7b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page