7

As far as I understand, the XDG guidelines recommend that applications store their configuration in $XDG_CONFIG_HOME/APP (usually ~/.config/APP) rather than ~/.APP (I'm not sure if there are also Debian/Ubuntu guidelines?). However, I have found a number of configuration files and folders using the older ~/.APP convention.

Is there a way to globally force non-confirming applications to use the XDG folder conventions?

Or do I just have to log a ticket with each project? :D

1
  • 1
    Note that some applications for backwards compatibility will use either, and so particularly if you have an old, repeatedly upgraded install you might be able to just move some old settings to $X_C_H. Unfortunately there is no easy way to know which applications this will work for a priori...
    – chronitis
    Dec 9, 2013 at 9:20

2 Answers 2

5

I don't see a way to force such behaviour globally, since default config paths are usually hardcoded into the programs.

If you are looking for an easy way to backup all your configs, you could create symlinks on a per-app basis from ~/.app to ~/.config/app. While this unfortunately won't unclutter your home, all config files will be saved in ~/.config for easier backups.

4

I found some excellent configuration information at XDG Base Directory support.

This gives great hints about setting things like:

export LESSHISTFILE="$XDG_CACHE_HOME"/less/history

so that legacy config / cache / data files can still use the XDG specified directories.

I also needed to add in my ~/.bashrc:

# XDG - set defaults as they may not be set
# See https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
# and https://wiki.archlinux.org/title/XDG_Base_Directory#Support
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"

if [ ! -w ${XDG_RUNTIME_DIR:="/run/user/$UID"} ]; then
  echo "\$XDG_RUNTIME_DIR ($XDG_RUNTIME_DIR) not writable. Unsetting." >&2
  unset XDG_RUNTIME_DIR
else
  export XDG_RUNTIME_DIR
fi

These are not set by default on Ubuntu 14.04 LTS.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .