Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# This hooks script syncs task warrior to the configured task server.
# The on-exit event is triggered once, after all processing is complete.
# Make sure this task folder exists
LOCK_FILE=$XDG_CACHE_HOME/task/autosync.lock
TASK_DATA_FOLDER=$(task rc.hooks=0 _get rc.data.location) # rc.hooks=0 disables hooks, preventing a loop
if [ ! -f $LOCK_FILE ]; then
touch $LOCK_FILE