xdg-user-dirs-update
Update user directory paths
TLDR
Change XDG's DESKTOP directory to the specified directory (must be absolute)
Write the result to the specified dry-run-file instead of the user-dirs.dirs file
SYNOPSIS
xdg-user-dirs-update
DESCRIPTION
The `xdg-user-dirs-update` command is a utility that updates the XDG user directories configuration based on the current user's locale and the settings defined in `/etc/xdg/user-dirs.defaults` and `~/.config/user-dirs.dirs`.
It ensures that the standard directories like `Desktop`, `Documents`, `Downloads`, `Music`, `Pictures`, and `Videos` are correctly localized and pointed to the appropriate locations in the user's home directory.
It's typically executed automatically during user login, often triggered by desktop environments or session managers to ensure a consistent and localized user experience. The script reads the configuration files, checks if the directories exist, and if not, creates them. If the directories exist but are not correctly configured or localized, it updates the configuration files accordingly, guiding users through potential updates or changes. Incorrectly configured or missing XDG user directories can cause issues with applications that rely on these standard locations to store user files, leading to unexpected behavior or data loss. Proper use of this utility helps to avoid these problems by ensuring directories match user language.
The main configuration is done by two files: /etc/xdg/user-dirs.defaults and ~/.config/user-dirs.dirs, where the first is a system wide default, and the second a user override. The command will try to read the environment variable inside both files.
CAVEATS
This command relies on the existence and proper configuration of the `xdg-user-dirs` package. Modifying the configuration files directly without understanding their purpose can lead to unexpected behavior. It's generally recommended to use `xdg-user-dirs-update` to manage these settings.
AUTOMATIC EXECUTION
`xdg-user-dirs-update` is typically executed automatically as part of the user's login process. This is often handled by the desktop environment or session manager. You usually do not need to run it manually.
TROUBLESHOOTING
If you encounter issues with your XDG user directories, you can try running `xdg-user-dirs-update` manually. Check the error messages and review the contents of `/etc/xdg/user-dirs.defaults` and `~/.config/user-dirs.dirs` to identify any configuration problems.
Also verify that $XDG_CONFIG_HOME environment variable is properly set.
CONFIGURATION FILES
The primary configuration files are `/etc/xdg/user-dirs.defaults` (system-wide defaults) and `~/.config/user-dirs.dirs` (user-specific overrides). These files define the mapping between XDG user directory names (e.g., `XDG_DESKTOP_DIR`) and their corresponding paths.
HISTORY
The `xdg-user-dirs` specification and associated utilities were developed to standardize the location of user directories across different desktop environments. This helps promote consistency and interoperability between applications. The first release and development happened at freedesktop.org.
`xdg-user-dirs-update` is a part of this suite of tools designed to manage these directories automatically and ensure they're correctly configured for each user.
SEE ALSO
xdg-user-dir(1), xdg-open(1), xdg-settings(1)