We incorrectly try to use XDG_DATA_HOME to figure where to write the menu file. If XDG_DATA_HOME is set, we use whatever value it has as output dir to write applications.menu to. Correct variable should be XDG_CONFIG_HOME. Note, if XDG_DATA_HOME is unset, we default to $HOME/.config which is correct default behaviour.