XDG user directories

From ArchWiki
Revision as of 22:19, 16 May 2012 by X2b (talk | contribs) (Created page with "Category:Desktop environments {{i18n|xdg-user-dirs-update}} '''xdg-user-dirs-update''' is a desktop-independent tool for configuring the location of certain user director...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

xdg-user-dirs-update is a desktop-independent tool for configuring the location of certain user directories. Many applications of various desktop environments use the directories specified by xdg-user-dirs-update internally.


xdg-user-dirs-update is part of the xdg-user-dirs package available in [local].


The config file

xdg-user-dirs uses a configuration file located at ~/.config/user-dirs.dir. Its format is as follows:


A complete file might contain multiple entries:



The contents of the configuration file can be modified directly with a call to xdg-user-dirs-update. As an example, xdg-user-dirs-update --set TEMPLATES ~/.templates will set the template directory to the specified directory with respect to the current user's $HOME:



Once set, any user directory can be viewed with xdg-user-dir. For example:

$ xdg-user-dir TEMPLATES

will show the template directory, which of course corresponds to the XDG_TEMPLATES_DIR variable in the config file.

Applications using user directories

User directories are used internally by many applications: For instance, the template directory is used by Nautilus and Thunar to determine where to look for files to be passed to the Create Document context menu, whereas the desktop directory is used by Xfdesktop to find .desktop files to be shown on the Desktop.