jschlatow / taskopen

Tool for taking notes and open urls with taskwarrior
GNU General Public License v2.0
363 stars 31 forks source link

Auto-run 'task annotate' on missing annotations #123

Closed dbogdanov closed 3 years ago

dbogdanov commented 4 years ago

Currently, to add a text file with notes for a task, one has to run two commands, task annotate and taskopen. Would it be possible to add an option to automatically create the required annotations (task 144 annotate Notes) and then open them in such cases? This would solve the use-case below.

➜  ~ task add TEST
Created task 144.
➜  ~ taskopen 144
No compatible annotation found.
Kevin-Mok commented 4 years ago

I made a fish function to do this for me, but yes, this would be a useful feature.

function task-notes
    task $argv[1] annotate Notes
    and taskopen $argv[1]
end
jschlatow commented 4 years ago

@dbogdanov, @Kevin-Mok Please have a look at the NO_ANNOTATION_HOOK configuration variable and the addnote script in the scripts directory. The NO_ANNOTATION_HOOK is executed if the task does not have any annotation.

dbogdanov commented 4 years ago

Thank you, this solves the issue. Perhaps adding this info to the "Add default notes" section of the README will help.