diff --git a/tasksd.c b/tasksd.c index e268653..c489cc2 100644 --- a/tasksd.c +++ b/tasksd.c @@ -15,7 +15,7 @@ * anything below it, so task_next(scope="fleet") also picks "fleet/console" * work. There is no list object: the scope IS the category. * - * Storage is one JSON file per task under $TASKDIR (default ~/.hermes/tasks): + * Storage is one JSON file per task under $TASKDIR (default $XDG_DATA_HOME/tasksd, else ~/.local/share/tasksd): * * t0001.json {"id","title","goal","scope","tags","state","priority", * "created","started","ended","result"} @@ -64,7 +64,14 @@ static char *tasks_root(void) home = getenv("HOME"); if (home == NULL) home = "/tmp"; - mcp_buf_printf(&b, "%s/.hermes/tasks", home); + { + const char *xdg = getenv("XDG_DATA_HOME"); + + if (xdg != NULL && *xdg != '\0') + mcp_buf_printf(&b, "%s/tasksd", xdg); + else + mcp_buf_printf(&b, "%s/.local/share/tasksd", home); + } return b.p; }