add support for XDG_DATA_HOME and XDG_STATE_HOME#2447
Open
tmzullinger wants to merge 2 commits intoMusicPlayerDaemon:masterfrom
Open
add support for XDG_DATA_HOME and XDG_STATE_HOME#2447tmzullinger wants to merge 2 commits intoMusicPlayerDaemon:masterfrom
tmzullinger wants to merge 2 commits intoMusicPlayerDaemon:masterfrom
Conversation
This builds on e8ce417 (Initial support for $HOME and some XDG variables inside the configuration file, 2025-02-28). It does not address the request in MusicPlayerDaemon#263 to use $XDG_DATA_HOME as the home for playlists, but is a step toward it.
This builds on e8ce417 (Initial support for $HOME and some XDG variables inside the configuration file, 2025-02-28).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to use
$XDG_STATE_HOMEin my config forstate_file. I saw the related request for$XDG_DATA_HOMEin #263 and decided to attempt adding support for each of them.I've used
$XDG_STATE_HOMEin my personal config with this patch, but I have not found a need for$XDG_DATA_HOMEpersonally, so it is only tested by the test suite.I am not sure if
GetAppStateDir()should be present. It might not map as well asGetAppCacheDir()does to the cache directory. I just usedstate_file "$XDG_STATE_HOME/mpd.state"in my local config, rather than placing a single file in anmpdsubdirectory. It might not make any sense to have it in the code, unless we want to default to$XDG_STATE_HOME/mpd/state? The same may be true forGetAppDataDir()but it seems more likely a subdirectory could be useful there.I'm not particularly skilled with C++, so the code is largely copied from the existing XDG support. Beware of silly bugs. :)