diff --git a/.config/kak/autoload/filetype/task.kak b/.config/kak/autoload/filetype/task.kak index 0741c41d..3f98267e 100644 --- a/.config/kak/autoload/filetype/task.kak +++ b/.config/kak/autoload/filetype/task.kak @@ -1,4 +1,4 @@ -hook global BufCreate .*[.]taskrc %{ +hook global BufCreate .*[.]?taskrc %{ set-option buffer filetype ini } diff --git a/.config/task/.gitignore b/.config/task/.gitignore index 38a9ae66..f7c4237e 100644 --- a/.config/task/.gitignore +++ b/.config/task/.gitignore @@ -1 +1,2 @@ secret.ini +recurrence diff --git a/.config/task/.ignore b/.config/task/.ignore index 38a9ae66..f7c4237e 100644 --- a/.config/task/.ignore +++ b/.config/task/.ignore @@ -1 +1,2 @@ secret.ini +recurrence diff --git a/.config/task/README.md b/.config/task/README.md index 264fe2a9..1b8bd597 100644 --- a/.config/task/README.md +++ b/.config/task/README.md @@ -1,11 +1,10 @@ -To set up: - -- The correct `.taskrc##template` file must be present in the homedir (also - tracked by yadm, so no problem) -- This directory must contain a `secret.ini` file which has the following: +This directory must contain a `secret.ini` file which has the following: ```ini sync.server.url=secret_here sync.server.client_id=secret_here sync.encryption_secret=secret_here ``` + +The `recurrence` file is handled by a `yadm` hook, see +`~/.config/yadm/hooks/post_pull`. diff --git a/.config/task/hooks/on-exit-sync.sh b/.config/task/hooks/on-exit-sync.sh index 76f6ad59..e5fd6ca4 100755 --- a/.config/task/hooks/on-exit-sync.sh +++ b/.config/task/hooks/on-exit-sync.sh @@ -1,5 +1,7 @@ #!/bin/sh +DATA="$HOME/.local/share/task" + n=0 while IFS= read -r _; do n=$((n + 1)) @@ -7,10 +9,10 @@ done if [ "$n" -gt 0 ]; then { - lockfile="$HOME/.task/sync_hook.lock" - errfile="$HOME/.task/sync_hook.err" - lerrfile="$HOME/.task/sync_hook.errl" - logfile="$HOME/.task/sync_hook.log" + lockfile="$DATA/sync_hook.lock" + errfile="$DATA/sync_hook.err" + lerrfile="$DATA/sync_hook.errl" + logfile="$DATA/sync_hook.log" flock "$lockfile" sh -c ' task sync >>"$1" 2>"$2" diff --git a/.config/task/taskrc.ini b/.config/task/taskrc similarity index 68% rename from .config/task/taskrc.ini rename to .config/task/taskrc index 5540c09d..49788dcd 100644 --- a/.config/task/taskrc.ini +++ b/.config/task/taskrc @@ -1,10 +1,11 @@ # [Created by task 3.4.1 6/16/2025 14:29:26] -data.location=/home/fic/.task +data.location=~/.local/share/task news.version=3.4.1 hooks.location=$HOME/.config/task/hooks urgency.user.urgent.coefficient=4.5 urgency.user.tag.later.coefficient=-6.0 urgency.user.project.thesis.coefficient=2.9 -recurrence=on +include ~/.config/task/secret.ini +include ~/.config/task/recurrence diff --git a/.config/yadm/hooks/post_pull b/.config/yadm/hooks/post_pull index 8e7e618d..8b1111c9 100755 --- a/.config/yadm/hooks/post_pull +++ b/.config/yadm/hooks/post_pull @@ -6,5 +6,5 @@ if [ -f "$HOME/.config/task/taskrc" ]; then else val="false" fi - printf 'recurrence=%s\n' "$val" >>"$HOME/.config/task/taskrc" + printf 'recurrence=%s\n' "$val" >"$HOME/.config/task/recurrence" fi diff --git a/.config/yadm/tracked b/.config/yadm/tracked index 71e6c6fa..335c3c88 100644 --- a/.config/yadm/tracked +++ b/.config/yadm/tracked @@ -76,6 +76,5 @@ .config/vesktop-flags.conf .config/qutebrowser .config/task -.taskrc##template .config/yadm/encrypt .local/share/yadm/archive diff --git a/.taskrc##template b/.taskrc##template deleted file mode 100644 index 31c60353..00000000 --- a/.taskrc##template +++ /dev/null @@ -1,5 +0,0 @@ -# GENERATED BY YADM TEMPLATE -# SEE .config/task/ - -{% include ".config/task/taskrc.ini" %} -{% include ".config/task/secret.ini" %}