taskwarrior_hooks/on-exit-sync.sh

16 lines
288 B
Bash
Raw Permalink Normal View History

2023-01-26 13:34:13 -05:00
#!/bin/sh
2023-01-26 13:40:43 -05:00
# from https://www.reddit.com/r/taskwarrior/comments/4mwhvk/a_script_to_autosync_after_every_modification/
2023-01-26 13:34:13 -05:00
# Count the number of tasks modified
n=0
while read modified_task
do
n=$(($n + 1))
done
if (($n > 0)); then
task sync >> ~/.config/task/sync_hook.log
fi
exit 0