From d747579b62bded75fde576026ff38a7928b19dc8 Mon Sep 17 00:00:00 2001 From: Sierra Date: Thu, 22 Oct 2020 17:03:29 -0400 Subject: [PATCH] set config location to the default XDG spec --- requirements.txt | 1 + tootgopher.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 168cc09..b6025d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ Mastodon.py >= 1.5.1 +pyxdg >= 0.27 diff --git a/tootgopher.py b/tootgopher.py index 9365033..a8b00c6 100755 --- a/tootgopher.py +++ b/tootgopher.py @@ -4,10 +4,11 @@ import json import os import tempfile from subprocess import call +from xdg import BaseDirectory # load JSON config file def load_config() -> dict: - with open('config.json') as f: + with open(f"{BaseDirectory.xdg_config_home}/tootgopher/config.json") as f: config_data = json.load(f) return config_data