The XDG Base Directory
Specification<http://standards.freedesktop.org/basedir-spec/>provides
some common paths in user's home to store personal application
configurations, or, using their own words "*defines where these files should
be looked for by defining one or more base directories relative to which
files should be located*".

XDG Base Directory Specification allows efficient backup, in which you can
easily choose to backup your data and/or your configuration files for
instance (see
http://ploum.frimouvy.org/?184-cleaning-user-preferences-keeping-user-data).
An application could easily propose such backup for the whole system
if
all applications were matching these specification

Therefore, although I think that this bug/enhancement is not vital, it would
be great for Sawfish to be "FreeDesktop XDG Base Directory Specification"
compliant. What do you think about it?

There's already some lisp code for configuration directory transition,
writen when the name was changed from sawmill to sawfish.

Currently Sawfish is using "$HOME/.sawfish/". This is what XDG basedir spec
defines:

   - $XDG_DATA_HOME (usually $HOME/.local/share/) as "*the base directory
   relative to which user specific data files should be stored*"
   - $XDG_CONFIG_HOME (usually $HOME/.config/) as "*the base directory
   relative to which user specific configuration files should be stored*"
   - $XDG_CACHE_HOME (usually $HOME/.cache/) as "*the base directory
   relative to which user specific non-essential data files should be stored
   *"

In order to make Sawfish XDG basedir compliant, I think that it would be
enough to use $XDG_CONFIG_HOME/sawfish instead of $HOME/sawfish

Glib (one sawfish dependencies, according to the .deb package) provides some
useful functions (since version 2.6) in order to retrieve the current
location of $XDG_*_HOME directories:

(
http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir
)

   - 
g_get_user_cache_dir<http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-user-cache-dir>
   - 
g_get_user_config_dir<http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir>
     
<http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir>
   - 
g_get_user_data_dir<http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-user-data-dir>

(Note that the basedir spec also defines system-wide directories for system
data and configuration, and glib provides g_get_system_data_dirs() and
g_get_system_config_dirs() functions to retrieve them).
I don't know how deep is the Gnome library involved in the code, though.
There's also a small library that might be useful, written for the only
purpose of xdg basedir spec compliance:
https://n.ethz.ch/student/nevillm/download/libxdg-basedir/


--
Ferk

Reply via email to