LLMpediaThe first transparent, open encyclopedia generated by LLMs

XDG Base Directory Specification

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Freedesktop.org Hop 4
Expansion Funnel Raw 1 → Dedup 1 → NER 1 → Enqueued 0
1. Extracted1
2. After dedup1 (None)
3. After NER1 (None)
4. Enqueued0 (None)
Similarity rejected: 2
XDG Base Directory Specification
NameXDG Base Directory Specification
Developerfreedesktop.org
Released2000s
OsUnix-like
GenreFilesystem hierarchy specification

XDG Base Directory Specification is a standards document maintained by freedesktop.org defining a set of conventions for per-user file locations on Unix-like operating systems. It aims to organize configuration, data, cache, and runtime files for desktop environments such as GNOME, KDE, and Xfce while promoting interoperability among applications developed by Red Hat, Canonical, Debian, and SUSE. The specification interacts with package systems and init systems used by systemd, Upstart, and SysV init and influences project layouts in GNOME Foundation, KDE e.V., and freedesktop.org member projects.

Background and Purpose

The specification originated in discussions among developers from freedesktop.org, the GNOME Project, and the KDE Community to address fragmentation caused by multiple conventions used by projects like Mozilla, OpenOffice.org, and AbiWord. It was motivated by cross-project needs similar to those addressed by the Filesystem Hierarchy Standard and initiatives by the Linux Foundation and The Open Group. By defining standard locations, the document enables desktop environments and distributions including Ubuntu, Fedora, Arch Linux, and Debian to present consistent behavior for applications from Canonical, Red Hat, SUSE, and Intel. The work echoes earlier efforts such as the X Window System and the Portable Operating System Interface while aligning with practices in projects like FreeDesktop and X.Org Foundation.

Specification Details

The specification prescribes distinct directories for configuration, data, cache, and runtime state to reduce clutter in user home directories and to support multi-tiered configuration loading used by applications like LibreOffice, Firefox, and Thunderbird. It specifies precedence rules and search order similar to those used by pkg-config, Autotools, and CMake in project discovery. The model is compatible with desktop frameworks from GNOME, KDE, Enlightenment, and LXDE and interacts with session management in projects such as LightDM, GDM, and SDDM. Implementations in toolkits like GTK, Qt, and EFL commonly consult these paths when locating resources, themes, and icons used by projects such as Adwaita, Breeze, and Faenza.

Environment Variables and Defaults

Key environment variables defined include those analogous to variables used in other standards: they provide paths for configuration, data, cache, and runtime directories which applications consult at startup, akin to how PATH and LD_LIBRARY_PATH operate for executables and shared libraries. Typical variables mirror patterns familiar from POSIX utilities, systemd runtime directories, and desktop session variables set by display managers such as LightDM and GDM. Defaults are expressed relative to the user's home directory to maintain compatibility with distributions like Fedora, Ubuntu, and openSUSE and to work with language bindings in Python, Perl, and Rust used by projects such as GNOME Software, KDE Plasma, and system tools from BusyBox.

Adoption and Implementations

Adoption spans major desktop environments and distributions: GNOME, KDE Plasma, Xfce, MATE, LXQt, and Enlightenment adopt the conventions; distributions including Debian, Ubuntu, Fedora, Arch Linux, and openSUSE ship software that respects the paths. Toolkits and libraries such as GLib, Qt, GTK, and libX11 provide helpers and utilities so applications like Evolution, KMail, Pidgin, and GIMP follow the rules. Package maintainers in projects like Debian Policy, RPM, Flatpak, and Snapcraft often refer to the specification when packaging applications for Launchpad, OBS, and COPR build systems. Container and sandboxing efforts by Docker, Podman, Flatpak, and Snap influence runtime behavior with container runtime projects and desktop portal implementations.

Compatibility and Migration Guidelines

Migration guidance for legacy applications—examples include Mozilla Thunderbird, OpenOffice.org, and older GNOME utilities—advises fallback strategies and transition paths as used in cross-project migrations undertaken by GNOME Foundation and KDE e.V. Strategies reference conventions from the Filesystem Hierarchy Standard, porting experiences from projects on GitLab, GitHub, and Savannah, and packaging practices followed by Debian maintainers and the Fedora Project. Developers are advised to implement layered lookup (system, site, user) and to provide backward-compatible behavior similar to techniques used when transitioning from /etc-based configurations to per-user settings in projects like systemd and X.Org Server.

Security and Privacy Considerations

Security guidance addresses risks from insecure file permissions, symlink attacks, and data leakage comparable to concerns handled in systemd unit security discussions and Linux kernel hardening initiatives. The specification recommends practices similar to those used by OpenSSH, sudo, and AppArmor to restrict access and to avoid storing sensitive credentials in world-readable files; integration with keyring services such as GNOME Keyring, KDE KWallet, and Secret Service API is encouraged. Privacy considerations mirror policies adopted by projects like Tor, Nextcloud, and Mozilla to minimize persistent tracking, to allow per-application cache management, and to respect user-controlled backup and syncing workflows used by services like Dropbox, Syncthing, and Nextcloud clients.

Category:Freedesktop.org standards