jschlatow / taskopen

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

integration with (neo)mutt via msgid #148

Closed gour closed 2 years ago

gour commented 2 years ago

Hello, I'd like to integrate (neo)mutt with Taskwarrior as I did with Claws-mail where I use xdg-mime mechanism.

It was easy since Claws-mail can open message passed as message-filename, while (neo)mutt can only open via msgid.

My integration script adds annotation so it looks like:

171  4h   email inbox      "Some task (2022-06-17 08:32:38)"                      
                             17.6.2022. 1138994717085.1134239284236.2047430149.0.330942JL.2002@some.domain.com

where the string denotes msgid.

There is script to open (neo)mutt message by passing msgid or it can be done in a straightforward way with:

neomutt -e "push '<search>~i MESSAGE-ID<enter>'"

Now, considering that both (neo)mutt and taskwarrior are CLI-apps, I do not required xdg-mime integration, but wonder if there is an easy way to configure Taskopen that it uses the above command when opening tasks annotated with (neo)mutt's msgid?

I can install 2.0beta if required...

jschlatow commented 2 years ago

@gour, the way to go is to define a regex that matches the annotation. You can use regex groups so that the msgid is will be made available in the environment variable $LAST_MATCH by taskopen. Please have a look at the usage example in the README.

gour commented 2 years ago

@gour, the way to go is to define a regex that matches the annotation. You can use regex groups so that the msgid is will be made available in the environment variable $LAST_MATCH by taskopen.

Thanks a lot!

I assume I need 2.0beta for that?

jschlatow commented 2 years ago

The example from the README is for 2.0, yet the feature was already implemented in 1.x only with a different config syntax (see taskopenrc.5.