todoist icon indicating copy to clipboard operation
todoist copied to clipboard

readable output with fzf selector

Open TheTaoOfPhil opened this issue 3 months ago • 0 comments

Hi,

I began my trial of todoist last week and was initially encouraged. But now I'm afraid I've run into too many issues with todoist in order to continue with it. I am running on manjaro and none of the arch repos have an up-to-date version. I tried to build from source with go version 1.12 but there were too many dependencies missing. I am not a go developer and so I don't know what would have been necessary to get it to work.

This is sad, because in the several days I have been trying to use the tool, I've grown rather fond of it.

I wanted to share a few things that it made it more fun to use.

I have rather long project names and found that the default output of list was unreadable.

For the purpose of selecting values with fzf, I modified todoist_functions_fzf.sh as follows:

select_items_command="todoist --csv --color list | awk -F',' '{printf \"%s %s \t%s \t%s\n\",\$1,\$3,substr(\$4,1,10),substr(\$6,1,60)}' | fzf --ansi | cut -d ' ' -f 1 "

The color comes out nicely in fzf and the selected value is returned properly to be consumed as an argument value.

Along similar lines, for displaying lists in general I made the following zsh command:

filter_val=$1
    watch -c -n 2 "todoist --csv --color list --filter \"${filter_val}\" | awk -F',' '{printf \"%s %s \t%s \t%s\n\",\$1,\$3,substr(\$4,1,10),substr(\$6,1,60)}'"

Sadly, there are too many things not working in the 0.18 version that is available through my package managers (e.g., setting date values and using colons in filter values).

It also is not encouraging that deprecated versions of tools (e.g., go 1.12 and urfave cli v 2) are required. It looked like the reason that the yay package maintainers were running into too many issues with the build to maintain it (this is unusual: typically the yay and pacman repos are kept quite up-to-date).

Thanks for listening.

TheTaoOfPhil avatar Apr 04 '24 23:04 TheTaoOfPhil