From b6a701708b2585ac394bbedf452e5b89fd250727 Mon Sep 17 00:00:00 2001 From: derrod Date: Fri, 15 May 2020 06:52:58 +0200 Subject: [PATCH] [lfs] Honor XDG_CONFIG_HOME env variables --- legendary/lfs/lgndry.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 233d717..4fbcfdb 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -13,7 +13,12 @@ from legendary.lfs.utils import clean_filename class LGDLFS: def __init__(self): self.log = logging.getLogger('LGDLFS') - self.path = os.path.expanduser('~/.config/legendary') + + if config_path := os.environ.get('XDG_CONFIG_HOME'): + self.path = os.path.join(config_path, 'legendary') + else: + self.path = os.path.expanduser('~/.config/legendary') + # EGS user info self._user_data = None # EGS entitlements