## xdg-user-dirs xdg-user-dirs is a tool to help manage "well known" user directories like the desktop folder and the music folder. It also handles localization (i.e. translation) of the filenames. The way it works is that xdg-user-dirs-update is run very early in the login phase. This program reads a configuration file, and a set of default directories. It then creates localized versions of these directories in the users home directory and sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config) that applications can read to find these directories. ## Settings Sysadmins can configure things by editing /etc/xdg/user-dirs.conf. At the moment there are only two settings, you can disable the whole thing, and you can specify the charset encoding used for filenames. They can also set or change the default directories and their initial values in /etc/xdg/user-dirs.defaults. $(XDG_CONFIG_HOME)/user-dirs.dirs specifies the current set of directories for the user. This file is in a shell format, so its easy to access from a shell script. This file can also be modified by users (manually or via applications) to change the directories used. Note: To disable a directory, point it to the homedir. If you delete it it will be recreated on the next login. Here is a shellscript example of how to find the desktop and the download directory: test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs echo ${XDG_DESKTOP_DIR:-$HOME/Desktop} echo ${XDG_DOWNLOAD_DIR:-$HOME} For application code the hope is that the various desktops will integrate this and have a nice API to find these directories. ## Translations Translations of xdg-user-dirs are now handled by the [[translation project|http://translationproject.org/]]. All translations should go through there. The merging from translation project to freedesktop.org is managed by Mikel Olasagasti. ## Code The [[Git|Infrastructure/git]] module for this code is [[xdg/xdg-user-dirs|http://cgit.freedesktop.org/xdg/xdg-user-dirs/]]. ### Download * * Respect $HOME in favour of getpwuid() * Updated translations * Documentation spelling fixes * * Added autostart file * * New translations * Added manpages * * New translations * Use right permissions on ~/.config if created (0700) * * New translations * Fix memory leak * Generate from git * * New translations * * New translations * Change "Download" to "Downloads" by default to match other names * Fix bashism in xdg-user-dir * * New translations * Update cut and paste code to handle oom and c++ * * New translations * Relocatable * Fix possible crash * * Remove accidental debug spew * * Don't recreate dirs set to $HOME * * New translations * Fixed buggy printouts on --force * Make xdg-user-dir-lookup.c #include:able * Add xdg_user_dir_lookup_with_fallback to xdg-user-dir-lookup.c * Add docs to xdg-user-dir-lookup.c * * New translations * * New translations * fix build with external libintl * * Create ~/.config dir if needed * * Build fixes * Update user-dirs.dirs atomically * * Add "Applications" to translations * Support --dummy-output to write config file elsewhere on update * Support --set to set a directory for the user * Save the locale used on initial run and forced update * This can be used to track changes in locale * * Added Projects/projects to list of translated keys * Also support non-homedir-relative directories in user-dirs.dir. * This isn't recommended (as it can cause problems with e.g. shared homedirs on multiple machines), but can be useful at times.