Problem
On Linux, the database, log, and config files are all being stored in $XDG_DATA_HOME which doesn't follow the XDG Base Directory Specification.
Proposed solution
There is no issue with any of these files being stored in a slumber subdirectory of the following proposed locations.
The database file (state.sqlite) should be stored in the dirs::data_dir, as it currently is, no change needed.
The config file (config.yml) should be stored in dirs::config_dir. This points to the same location on macOS and Windows, so would be backwards compatible for those platforms, but would be different for Linux (i.e. $XDG_CONFIG_HOME not $XDG_DATA_HOME). This would be a breaking change.
The log file (slumber.log) is more tricky. According to the spec, this should be stored in $XDG_STATE_HOME on Linux, provided by dirs::state_dir. However, this does not have Windows and macOS equivalents in the dirs crate. For Windows and macOS, the dirs::cache_dir would be an acceptable fallback. This would be a breaking change.
Additional context
- XDG Base Directory Specification
dirs crate
Problem
On Linux, the database, log, and config files are all being stored in
$XDG_DATA_HOMEwhich doesn't follow the XDG Base Directory Specification.Proposed solution
There is no issue with any of these files being stored in a
slumbersubdirectory of the following proposed locations.The database file (
state.sqlite) should be stored in thedirs::data_dir, as it currently is, no change needed.The config file (
config.yml) should be stored indirs::config_dir. This points to the same location on macOS and Windows, so would be backwards compatible for those platforms, but would be different for Linux (i.e.$XDG_CONFIG_HOMEnot$XDG_DATA_HOME). This would be a breaking change.The log file (
slumber.log) is more tricky. According to the spec, this should be stored in$XDG_STATE_HOMEon Linux, provided bydirs::state_dir. However, this does not have Windows and macOS equivalents in thedirscrate. For Windows and macOS, thedirs::cache_dirwould be an acceptable fallback. This would be a breaking change.Additional context
dirscrate