This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

GNOME Goal: XDG Base Directory Specification Usage

Problem

Unix like systems have traditionally lacked a standard way to store application or user data on a per-user basis. Consequently these data are often stored in an ad-hoc, inconsistent, and problematic way in "dot files" of the user's home directory.

This is a problem because:

See one example user's story in this post.

Guidelines

FreeDesktop has issued a recommended solution for this problem.

Read this more detailled explanation of the XDG specification.

Bonus point: if the user chooses a default preference, this preference should not be saved anywhere and the corresponding entry in the config file should be empty (or "default" or whatever). This way, we are sure that an user does not keep the 10 years old default without even noticing it and that his default setup is correctly upgraded.

{i} Instructions on how to recognize a module affected by this goal.

The application is a target for this goal if:

Examples

GLib

const char *cache_dir = g_get_user_cache_dir ();
char *mydir = g_build_filename (cache_dir, "myapp", NULL);
/* use it */
g_free (mydir);

Python

import os
from gi.repository import GLib
mydir = os.path.join(GLib.get_user_config_dir(), 'myapp')

or

_runtime_dir = os.environ.get('XDG_RUNTIME_DIR', os.environ.get('XDG_CACHE_HOME', os.path.join(os.path.expanduser("~"), '.cache')))
_config_dir = os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser("~"), '.config'))
_cache_dir = os.environ.get('XDG_CACHE_HOME', os.path.join(os.path.expanduser("~"), '.cache'))
_data_dir = os.environ.get('XDG_DATA_HOME', os.path.join(os.path.expanduser("~"), '.local/share'))

Vala

Environment.get_user_cache_dir()

Migration

A good example are the empathy patches by fpeters:

GLib convenience functions: here

Status of this goal

{i} Tip: If you choose to work on a module, create the bug report on the GNOME bugzilla. This way people will know someone already works on it, and won't duplicate the work you're doing.
/!\ Please make the bug report depend on the tracker bug for this goal.

State

Markup

todo

<: #ff8080> todo

patch

<: #ffc849> [[GnomeBug:xxxxx|patch]]

done

<: #80ff80> [[GnomeBug:xxxxx|done]]

not needed

<: #80ff80> not needed

Above are the states and corresponding markup to update the modules state table below.

Tarball

Status

core

epiphany

done

evolution-data-server

done

gdm

done

gnome-control-center

not needed

gnome-desktop

done

gnome-menus

not needed

gnome-settings-daemon

done

gnome-shell

done

gstreamer

done

gvfs

done

mutter

done

nautilus

done

telepathy-mission-control

done

core-utilities

brasero

done

empathy

done

eog

done

evince

done

file-roller

done

gcalctool

not needed

gnome-dictionary

done

gnome-font-viewer

done

gnome-icon-theme

not needed

gnome-keyring

done and done

totem

done

yelp

done

core-extra

gnome-backgrounds

not needed

core-fallback

gconf

done

gnome-panel

done done

metacity

done

core-os-services

dbus

patch

NetworkManager

not needed

PackageKit

done

pulseaudio

done

core-deps

gnome-doc-utils

not needed

gtk+

done

fontconfig

done

libgnomekbd

674874 674873 - done

libgtop

not needed

libgweather

not needed

libICE

to do

librsvg

not needed

libsoup

not needed

libwnck

not needed

mousetweaks

done

pango

done

poppler

done

totem-pl-parser

not needed

zenity

not needed

apps

accerciser

done

anjuta

done

cheese

done

devhelp

not needed

evolution

done

gedit

done

glade

done

gnome-games

done

gnome-devel-docs

not needed

gnome-nettool

not needed

grilo

done

orca

done

seahorse

not needed

totem

done

vinagre

done

Other

abiword

done

abrt

done

alacarte

done

aMule

to do

Anthy

to do

aptitude

Expected a color value "#" after "#"

done

Ardour

done

arduino

bug needed

Audacity

to do

bash

WONT DO

banshee

done

Blender

done done

baobab

done

bzr

done

cabal

to do

patch wanted

clamz

to do

Chrome

done

conky

to do

compiz

to do

CUPS

WON'T FIX

d-feet

done

Darktable

to do

deskbar-applet

done

Desura

to do

Dropbox

to do

EasyTAG

done

Eclipse

to do

Help wanted

Elluminate

to do

emacs

to do

fedora-packager-setup

WON'T FIX

Festival

to do

Filezilla

done

FontForge

to do

freecol

done

firefox

to do

patch wanted

flash plugin

WON'T FIX

galculator

done

gimp

done, done

git

done

gitk

done

git-bz

done

gksu

to do

gnome-exe-thumbnailer

to do

gnome-tweak-tool

done

gnote

done

gnumeric

to do

gnupg

WON'T FIX

Google Earth

to do

gthumb

done

guvcview

to do

hamster-applet

done

hardinfo

to do

Hugin

to do

jackd

to do

jhbuild

done

kdenlive

to do

less

patch sent via email

lftp

to do

libdvdcss

to do, to do

libreOffice

done

libreport

done

libvirt

done

lightdm

to do

imsettings

done

m17n-lib

to do

matplotlib

to do

minecraft

to do

mono

done

mplayer

to do

mtpaint

to do

MyPaint

done

nss

to do

npm

to do

patch wanted

Octave

to do

patch wanted

onboard

to do

OpenShot

to do

Opera

to do

pidgin

to do

patch wanted

planner

done

reinteract

to do

remmina

to do

rhythmbox

done

rpm

to do

SANE

to do

Scribus

to do

SCUMMVM

to do

setroubleshoot

to do

Shotwell

done

Shutter

to do

Skype

to do

speech-dispatcher

done

spice

done

ssh

WON'T FIX

stardict

to do

Steam

to do

stellarium

to do

subversion

to do

synaptic

to do

systemtap

to do

Thunderbird

to do

Titanium

to do

Transmission

done

tomboy

done

Twinkle

to do

ufraw

done

Vidyo

to do

vim

to do

virt-manager

done, done

VirtualBox

to do

VNC

to do

Wine

WON'T FIX

wxWidgets

to do

patch wanted

XChat

patch

xchat-gnome

patch

Xine

to do

xsane

to do

xscreensaver

WON'T FIX

See Also


2024-10-23 11:17