Open jdorel opened 3 years ago
Wanted to share a workaround to the limited number of custom shortcut options until a more substantial framework can be built.
It's a pretty simple shell script that I've bound to one of the numbered shortcuts, then using fzf I can select from a list of scripts. This includes passing along the task IDs as arguments.
#!/bin/bash
TASK=$@
echo "
$HOME/.dotfiles/taskwarrior/create-zettle.sh
$HOME/.dotfiles/taskwarrior/copy-tasks-as-list.sh
$HOME/.dotfiles/tmux/tmux-nav-agenda.sh
$HOME/.dotfiles/taskwarrior/add-phone.sh
$HOME/.dotfiles/taskwarrior/work-plan.sh day
" | fzf --reverse | xargs -I {} sh -c "{} $TASK"
Then in .taskrc
, I just call the script with one of the shortcuts.
uda.taskwarrior-tui.shortcuts.6=~/.dotfiles/taskwarrior/tui-script-list.sh
Now I can add as many scripts as I need to the list and access them quickly in the TUI. Ideally, I'd like the level of shortcut customization as found in vim or mutt but I know that's a lot of work.
Super neat hack! Thanks for sharing!
Description
Currently :
One could have the following in his
taskrc
file :And the file
~/.config/taskwarrior-tui/functions/set-next-tag.sh
would contain :Task UUID would be given as an argument to this function call. Maybe some additional informations could be useful ? Or they should be obtained from the UUID ?
We could even do without the
uda.taskwarrior-tui.functions.set-next-tag.location
if by default we are looking for.sh
files (or others like.py
). We would use the<function_name>
(set-next-tag
in the example) as a filename.Default functions location could be :
Advanced implementation could include how to configure combination shortcuts (ex:
Ctrl+n
) or modal shortcuts (ex:t
thenn
for tag-->next).Additional context : #140