Skip to content

Add support for the XDG Base Directory Support with an automated migration path.

Ghost User requested to merge (removed):master into master

Hey!

I would like to discuss and possible merge this feature for DIA. The XDG Base Directory Specification defines where user-specific application files should be stored accordingly to three concepts: configuration files, data files and cache files. The main objective is to remove dotfiles dirs in users' home directory that stores everything from a given application.

With that being said, there are three important environment variables (LINUX example) for setting where to store each category:

Variable Default Value
XDG_CACHE_HOME $HOME/.cache
XDG_CONFIG_HOME $HOME/.config
XDG_DATA_HOME $HOME/.local/share

For dia, I did the following split (my installation was my reference):

Old location New location
Data dirs --------
$HOME/.dia/objects ${XDG_DATA_HOME}/dia/objects
$HOME/.dia/shapes ${XDG_DATA_HOME}/dia/shapes
$HOME/.dia/sheets ${XDG_DATA_HOME}/dia/sheets
$HOME/.dia/lines ${XDG_DATA_HOME}/dia/lines
$HOME/.dia/xslt ${XDG_DATA_HOME}/dia/xslt
$HOME/.dia/python ${XDG_DATA_HOME}/dia/python
Data files --------
$HOME/.dia/persistence ${XDG_DATA_HOME}/dia/persistence
$HOME/.dia/defaults.dia ${XDG_DATA_HOME}/dia/defaults.dia
Config Files --------
$HOME/.dia/menurc ${XDG_CONFIG_HOME}/dia/menurc
$HOME/.dia/pluginrc ${XDG_CONFIG_HOME}/dia/pluginrc
$HOME/.dia/diagtkrc ${XDG_CONFIG_HOME}/dia/diagtkrc

I also coded an automated migration path, so we can move legacy installations without problems.

Looking forward to your feedback!

[]s,

Edênis

Merge request reports