This seems like a simple question that every application developer would have, but I can't find the answer.
Per the latest XDG Basedir Spec, there are many directories that should be defined in environment variables. As one example:
There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME.
Let's say my Bash script saves a user config - and I want to follow the XDG spec - How do I find
$XDG_CONFIG_HOME? It makes sense that you would do something like
#!/bin/bash # Print out $XDG_CONFIG_HOME echo Your XDG_CONFIG_HOME is: [$XDG_CONFIG_HOME]
But running this on a fresh Ubuntu and Fedora Silverblue install both give the output:
$ ./test.sh Your XDG_CONFIG_HOME is: 
Which seems totally useless, since that would mean on fresh desktop installs of Ubuntu and Fedora Silverblue, my app would write config files into the running directory. Yet, I can see so many applications properly putting the data in
~/.config/. Where are these apps finding the XDG environment variables, and how can I find them too?