diff --git a/Changelog.md b/Changelog.md index fc35fb6..a80e130 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +* **Breaking Change**: Respect `XDG_CONFIG_HOME` on Linux. + ## [1.2.0] - 2025-04-15 ### Added diff --git a/Source/Main.cpp b/Source/Main.cpp index 17f4222..465aa07 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp @@ -31,6 +31,16 @@ class MStarPlayerApplication : public juce::JUCEApplication juce::PropertiesFile::Options options; options.applicationName = "MStarPlayer"; options.filenameSuffix = ".settings"; +#ifdef JUCE_LINUX + if (const char* path = std::getenv("XDG_CONFIG_HOME")) + { + options.folderName = path + juce::String("/MStarPlayer"); + } + else if (const char* home = std::getenv("HOME")) + { + options.folderName = home + juce::String("/.config/MStarPlayer"); + } +#endif m_applicationProperties.setStorageParameters(options); if (m_applicationProperties.getUserSettings()->getValue("language") == "de")