Support XDG base directory spec
Right now Nemiver stores its user-specific data in ~/.nemiver
,
contributing to pollution of the home directory with dotfiles. The XDG
base directory spec tries to solve this problem and is natively
supported by glibmm (via functions get_user_data_dir()
,
get_user_config_dir()
, get_user_cache_dir()
).
Note that the XDG spec (unlike the ${APP}_HOME
approach of yore)
separates user data (precious), user configuration (OK to lose, but you
still better back it up) and cache (don't pollute my backups with your
image thumbnails). The distinction between the first two is somewhat
fuzzy, but the third should clearly be kept separate.
As far as I can see, there are two places in the source code that
reference ~/.nemiver
:
-
ConfManager::parse_user_config_file()
references~/.nemiver/config/nemiver.conf
. This should clearly become$XDG_CONFIG_HOME/nemiver/nemiver.conf
. -
SessMgr::priv::get_db_file_path()
references~/.nemiver/nemivercommon.db
viaConfMgr::get_user_config_dir_path()
. Note that the latter returns~/.nemiver
and not~/.nemiver/config
as one might think from the function name. I'm not clear about whatnemivercommon.db
does and which of the three XDG directories it belongs into.
If you wish, I can write a simple patch that abandons ~/.nemiver
and
transitions to XDG directories completely. Alternatively, with a little
more effort we can use ~/.nemiver
if it exists and the XDG directories
otherwise. In any case I'd need to know whether I missed anything above
and what nemivercommon.db
does.