volk icon indicating copy to clipboard operation
volk copied to clipboard

Update Linux config file folder location to follow XDG base directory specification

Open marcusmueller opened this issue 6 months ago • 1 comments

~/.volk is bad on Linux; we should be going for .config/volk for configuration; compare https://github.com/gnuradio/gnuradio/pull/7136

marcusmueller avatar Jul 17 '25 13:07 marcusmueller

Thank you for the suggestion.

From the linked issue, I extracted that the relevant part would be the XDG_CONFIG_HOME part where the kernel config should be located.

In this new configuration, gr::paths::userconf() (and the legacy, gr::userconf_path()) tries to find the user configuration in the following order:

  1. $GR_PREFS_PATH if that environment variable is set
  2. $XDG_CONFIG_HOME/gnuradio; if $XDG_CONFIG_HOME is set, and $XDG_CONFIG_HOME/gnuradio exists and is a directory
  3. appdata()/.config/gnuradio (appdata ~= $HOME) if that exists and is a directory
  4. appdata()/.gnuradio if that exists and is a directory
  5. $XDG_CONFIG_HOME/gnuradio if $XDG_CONFIG_HOME is set
  6. appdata()/.config/gnuradio

So, in other words: unless explicitly set to something else, try the new XDG_CONFIG_HOME path, if that doesn't exist, try the old path, and if neither exists, use the new one.

Alternatively, we need to consider the XDG_CACHE_HOME option because it resembles the FFTW wisdom use case.

jdemel avatar Jul 20 '25 15:07 jdemel