Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can i set default config dir in home folder?

I dislike:


I want:

share|improve this question

Generally this is not possible, as programs tend to hardcode (put the path directly into the source code) the config directory path (exceptions exist, see the darent's answer).

For example:

I use stackapplet which informs me of status changes on my askubuntu account. In its code it says (

CONFIG_FILE_PATH = os.path.join(os.path.expanduser("~"),".stackapplet") 

which sets the CONFIG_FILE_PATH to ~/.stackapplet. I would have to change the source code manually to override this.

Another example: wireshark

homedir = getenv("HOME");
if (homedir == NULL) {
    pwd = getpwuid(getuid());
    if (pwd != NULL) {
        homedir = g_strdup(pwd->pw_dir);
    } else
        homedir = "/tmp";
persconffile_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", homedir, PF_DIR);

This gets the home directory path either from the HOME environment variable, or from the /etc/passwd entry for the current user, or it sets it to /tmp if all fails.

Different programs get the HOME path in different ways, you just can't change all the "home" references to /home/user/.config.

share|improve this answer
i think so too, but maybe we have alternatives? e.g set default ~ variable and make:<br/> /home/user/files/Music/home/user/.config1 <br/>//arrrrrrr stupid engine. need newline in comments. Religion forbids using nl2br? – Shara Sep 7 '11 at 21:51

That depends on each program more than on the system. In some cases you can launch them with shortcuts to specific configurations. ie:

conky -c /home/user/.config/.conkyrc

dosbox /home/user/.config/.dosbox/

Those comands would save their configurations inside .config (i also dislike having my home full of small files and folders). But I don't know if there's a way to make it default or you'd have to set the configuration and the launche for each program (that if they allow you to set it). I don't think since that would mean changing your whole $HOME value. Somebody correct me if I'm wrong.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.