roelj / inklingreader

A GNU/Linux-friendly version of the Wacom Inkling SketchManager.
GNU General Public License v3.0
50 stars 16 forks source link

Support XDG basedir spec for config file #23

Closed su-v closed 10 years ago

su-v commented 10 years ago

AFAIU the currently supported location of the config file is $HOME/.inklingreaderrc.

Would it make sense to you to support the user's definition of $XDG_CONFIG_HOME instead, based on the XDG Base Directory Specification?

From the spec:

and:

roelj commented 10 years ago

Should it store the config file at:

$XDG_CONFIG_HOME/.inklingreaderrc

Or at:

$XDG_CONFIG_HOME/inklingreader/config

According to this specification?

su-v commented 10 years ago

Probably depends on your further plans - AFAIU the spec does not define further specific details about this.

Based on what other (e.g. GNOME or GTK-based) apps do, the config file(s) are stored in a subdir named like the app itself:

$XDG_CONFIG_HOME/inklingreader/

The file name of the actual config file then seems to vary wildy (config.ini, ${app_name}rc, ${app_name}.xml, ${app_name}.cfg, etc).

If you only ever need a single file for the config, it probably could also be

$XDG_CONFIG_HOME/inklingreaderrc

i.e. a config file directly in $XDG_CONFIG_HOME, not hidden (since the XDG user config dir is already hidden) - maybe peek into your ~/.config for more examples?

See also: https://wiki.gnome.org/action/show/Initiatives/GnomeGoals/XDGConfigFolders (has links to Glib utility functions, and other information).

roelj commented 10 years ago

I've updated the code to use this specification. I think we only need one config file. My system doesn't use XDG_CONFIG_HOME, so my config is located in ~/.config/inklingreaderrc.