Use XDG user configuration settings location

Bug #860088 reported by Luca Ferretti
42
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Ubuntu Developer Portal
Invalid
Medium
David Planella

Bug Description

from http://developer.ubuntu.com/publish/my-apps-packages/
"Write all configuration settings to ~/.config/<package-name> (This can be one file or a directory containing multiple configuration files)"

This is of course a legitimate suggestion, but it makes no mention of the other XDG directories ~/.cache and ~/.local, leading application developers to think they must only use ~/.config and are not allowed to use the others. But we should be encouraging developers to put cache files in the proper place, instead of in the config folder.

Tags: cms-copy
Revision history for this message
David Planella (dpm) wrote :

Adding a task for MyApps for ISD to confirm whether both the ~/.<pkgName> and ~/.config/<pkgName> layouts are supported. If so, it will just be a matter of updating the text on the page.

summary: - risky suggestion about user configuration settings location
+ Use XDG user configuration settings location
tags: added: cms-copy
Changed in ubuntudeveloperportal:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → David Planella (dpm)
Revision history for this message
Jorge Castro (jorge) wrote :

cc'ing Stuart L.

Don't we want to do not just one directory, but .config, .local, and .cache so that it's possible to separate the local machine state from the data? (for things like syncability?)

Revision history for this message
David Planella (dpm) wrote :

Some more info.

Nick Barcet says:

Where it says:
"Write all configuration settings to ~/.<pkgName>"

I believe this should be changed at least to "~/.config/<pkgName>" as
freedesktop define "$XDG_CONFIG_HOME defines the base directory relative
to which user specific configuration files should be stored. If
$XDG_CONFIG_HOME is either not set or empty, a default equal to
$HOME/.config should be used." [1]

[1]http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Revision history for this message
Michael Terry (mterry) wrote :

Hello! I will update this bug's description because nowadays the website says ~/.config/<package-name>. But the job here isn't done, because we should also be recommending ~/.cache and ~/.local.

This is a pet peeve of mine. I have seen apps that put a lot of data cache files (mp3 files, images, etc) in ~/.config because of this recommendation. This has a direct effect on users. For example, the default backup program deja-dup will automatically ignore ~/.cache but does back up ~/.config by default -- so when apps store large cache data in ~/.config, it wastes users' time and space.

I would request the following text be added to the Technical Requirements section of http://developer.ubuntu.com/publish/my-apps-packages/ :

 * Write all cache files to ~/.cache/<package-name> (This can be one file or a directory containing multiple cache files)
 * Write all user data files to ~/.local/share/<package-name> (This can be one file or a directory containing multiple data files)

And optionally, maybe even link to the XDG spec for full gory details (http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html)

description: updated
Revision history for this message
Christoph Aschwanden (8mabmzqcnyc1g4i7tjy-contact) wrote :

As a developer, I second the motion of allowing applications/games to write cached data to ~/.cache/<package-name>.

David Planella (dpm)
Changed in developer-portal:
status: New → Invalid
no longer affects: developer-portal
Revision history for this message
Daniel Holbach (dholbach) wrote :

David: is this relevant in the new world of Ubuntu apps? Do we need to explain the XDG directories or is this taken care of through the APIs we recommend?

Changed in ubuntudeveloperportal:
status: Triaged → Incomplete
Revision history for this message
Daniel Holbach (dholbach) wrote :
Changed in ubuntudeveloperportal:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.