From e61c35a5cd78775bef94910288cb3654a2a085da Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Tue, 9 Sep 2025 18:41:12 +0300 Subject: [PATCH] [lfs] Only check XDG_CONFIG_HOME when not on 'Windows' When running legendary through Wine and `XDG_CONFIG_HOME` is set in the environment, `config_path` resolves to the absolute path to the Linux config directory. Wine in turn resolves the path in the way that Legendary uses the existing Linux host config directory instead of creating/using the one under Wine prefix in `%USERPROFILE%\.config` --- legendary/lfs/lgndry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 16fcdf3..487e805 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -26,6 +26,10 @@ class LGDLFS: def __init__(self, config_file=None): self.log = logging.getLogger('LGDLFS') + # This can happen only when running in Wine under an OS using freedesktop + if os.name == 'nt' and os.environ.get('XDG_CONFIG_HOME', None): + del os.environ['XDG_CONFIG_HOME'] + if config_path := os.environ.get('LEGENDARY_CONFIG_PATH'): self.path = config_path elif config_path := os.environ.get('XDG_CONFIG_HOME'):