From a4bbb0ed3a8175f5d291e2a2fc2f165ea86d91d6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 22 Jun 2025 18:41:56 +0200 Subject: [PATCH] task: Add new repository for idea collection Following this blogpost: https://eshapard.github.io/code/a-separate-taskwarrior-configuration-for-ideas.html I think it is a really good idea to try this out. At first I was collecting ideas in my regular taskwarrior repository -- this was no good as every task list was flooded by somedays and maybes which would never leave. But I still wanted to have a nice repository to collect all my ideas in. So, the second strategy was to have one big (markdown) file which would simply collect all my ideas. But now I was doubling and tripling them up because the list was so long, and it was more of a chore to find where to put everything than just a quick 'idea add'. This may be the best of both worlds: making use of the nice interface to a task database using the full strength of taskwarrior querying, without cluttering up my main task repository. The workflow is exactly as with regular taskwarrior, only the executable is not called `task` (or `t` in my case) but `idea`. So you e.g. add an idea with `idea add`, or query all diy ideas with `idea +diy`. Just like regular taskwarrior. --- office/.config/sh/alias.d/taskwarrior.sh | 6 ++++++ office/.config/sh/env.d/taskwarrior-xdg.sh | 7 ++++++- office/.config/task/taskrc | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/office/.config/sh/alias.d/taskwarrior.sh b/office/.config/sh/alias.d/taskwarrior.sh index dc70002..8b3a820 100644 --- a/office/.config/sh/alias.d/taskwarrior.sh +++ b/office/.config/sh/alias.d/taskwarrior.sh @@ -39,3 +39,9 @@ alias tad="task +ACTIVE done" alias tas="task +ACTIVE stop" alias to="task note" + +#--- + +idea() { + task rc.data.location="$TASK_DATA_IDEA" "$@" +} diff --git a/office/.config/sh/env.d/taskwarrior-xdg.sh b/office/.config/sh/env.d/taskwarrior-xdg.sh index 1d75474..ef26b7a 100644 --- a/office/.config/sh/env.d/taskwarrior-xdg.sh +++ b/office/.config/sh/env.d/taskwarrior-xdg.sh @@ -1,3 +1,8 @@ #!/usr/bin/env sh -[ -d "$XDG_DATA_HOME/task/notes" ] || mkdir -p "$XDG_DATA_HOME/task/notes" + +export TASK_DATA_HOME="$XDG_DATA_HOME/task" +export TASK_DATA_IDEA="$XDG_DATA_HOME/ideas" + +[ -d "$TASK_DATA_HOME/notes" ] || mkdir -p "$TASK_DATA_HOME/notes" +[ -d "$TASK_DATA_IDEA/notes" ] || mkdir -p "$TASK_DATA_IDEA/notes" diff --git a/office/.config/task/taskrc b/office/.config/task/taskrc index 8539bd5..d6d8104 100644 --- a/office/.config/task/taskrc +++ b/office/.config/task/taskrc @@ -10,7 +10,7 @@ # Use the command 'task show' to see all defaults and overrides # Files -data.location=$XDG_DATA_HOME/task +data.location=$TASK_DATA_HOME # disable case sensitivity search.case.sensitive=no