Add environment variables

This commit is contained in:
Marty Oehme 2025-03-31 21:32:00 +02:00
parent dca5ebb9fb
commit 9e9b840ed0
Signed by: Marty
GPG key ID: 4E535BC19C61886E

14
topen
View file

@ -5,18 +5,24 @@
# Edits an existing task note file, # Edits an existing task note file,
# or creates a new one. # or creates a new one.
# It currently assumes an XDG-compliant taskwarrior configuration by default.
import argparse import argparse
import os
import subprocess import subprocess
import sys import sys
from pathlib import Path from pathlib import Path
from tasklib import Task, TaskWarrior from tasklib import Task, TaskWarrior
TASK_DATA_DIR = "~/.local/share/task" # TODO: This should not assume XDG compliance for
# no-setup TW instances.
TASK_RC = os.getenv("TASKRC", "~/.config/task/taskrc")
TASK_DATA_DIR = os.getenv("TASKDATA", "~/.local/share/task")
TOPEN_DIR = "~/.local/share/task/notes" TOPEN_DIR = os.getenv("TOPEN_DIR", "~/.local/share/task/notes")
TOPEN_EXT = "md" TOPEN_EXT = os.getenv("TOPEN_EXT", "md")
TOPEN_ANNOT = "Note" TOPEN_ANNOT = os.getenv("TOPEN_ANNOT", "Note")
def parse_cli() -> argparse.Namespace: def parse_cli() -> argparse.Namespace: