<SOLVED>Force Atom to use a specific .config folder


#1

Hey mates. I’ve started some dev work with Atom packages and there are times when I’d like to test a specific configuration, or want a clean .config folder without messing up my current one, or some other time when I’d like to point Atom to start with a specific .config folder instead of ~/.atom. Is it possible to do this?

In other words, I’d use .atom for normal use, but I might occasionally want to tell Atom to use .atom_test as its config directory for a single session (so, multiple configuration folders on the same local machine). I’ve tried doing something like atom --profile-directory=/home/fred/.atom2 but that doesn’t seem to have any effect.

Any ideas how this would be possible?
Cheers!
Fred


Change location of atom directory
#2

I believe the use of the .atom directory is hard-coded, but you could move it to directories such as .atom-default or .atom-nuclide and then create a symbolic link with the name .atom that you can change to point at whichever set of configurations you want.


#3

You can use the ATOM_HOME environment variable. It’s even in the help :grinning:

$ atom --help
Atom Editor v1.13.0-dev-14b8da1

Usage: atom [options] [path ...]

One or more paths to files or folders may be specified. If there is an
existing Atom window that contains all of the given folders, the paths
will be opened in that window. Otherwise, they will be opened in a new
window.

Environment Variables:

  ATOM_DEV_RESOURCE_PATH  The path from which Atom loads source code in dev mode.
                          Defaults to `~/github/atom`.

  ATOM_HOME               The root path for all configuration files and folders.
                          Defaults to `~/.atom`.

<snip>

#4

@leedohm Indeed, I did notice that but I wasn’t sure how to set the ATOM_HOME variable (probably should have mentioned that in my first post :grinning:)

I’ve tried atom ATOM_HOME=/home/fred/.atom_backup but that doesn’t work.


#5

If you’re running using a shell like bash or zsh you should be able to use:

$ ATOM_HOME=/home/fred/.atom_backup atom .

to launch Atom in the alternate way. Or you could do export ATOM_HOME=/home/fred/.atom_backup to switch to the alternate, launch Atom, leave Atom, and do unset ATOM_HOME to go back to normal.


#6
$ ATOM_HOME=/home/fred/.atom_backup atom

Bingo! This works. :slight_smile:

Thanks @leedohm!