From 652d5973e2dbb540213a87f525b140c6a0a5c433 Mon Sep 17 00:00:00 2001 From: Ross Brunton Date: Sat, 4 Apr 2026 17:46:07 +0100 Subject: [PATCH] Use XDG_STATE_HOME for config path Use XDG_STATE_HOME rather than ~/.linuxmint for storing updates.json if the latter does not exist. This cuts down on the amount of cruft in user's home directories. If the older path exists, it will be used, meaning there will be no change to existing installs/setups. --- usr/lib/linuxmint/mintUpdate/Classes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr/lib/linuxmint/mintUpdate/Classes.py b/usr/lib/linuxmint/mintUpdate/Classes.py index 53300c74..7417ce6c 100644 --- a/usr/lib/linuxmint/mintUpdate/Classes.py +++ b/usr/lib/linuxmint/mintUpdate/Classes.py @@ -33,7 +33,10 @@ if CONFIGURED_KERNEL_TYPE not in SUPPORTED_KERNEL_TYPES: CONFIGURED_KERNEL_TYPE = "-generic" -CONFIG_PATH = os.path.expanduser("~/.linuxmint/mintupdate") +CONFIG_PATH = os.path.join(os.environ.get("XDG_STATE_HOME", os.path.expanduser("~/.local/state")), "mintupdate") +# Fall back to legacy path if it exists +if os.path.isdir(os.path.expanduser("~/.linuxmint/mintupdate")): + CONFIG_PATH = os.path.expanduser("~/.linuxmint/mintupdate") # Used as a decorator to run things in the background def _async(func):