Change location of atom directory


#1

Hi,

Atom currently stores all the settings and downloaded packages into ~/.atom. Unfortunately the company i’m working for enforces a size limit of this directory to 30 MB. Is there any way for me to change this setting (to be outside the home directory) ?

Thanks!

Alex


#2

There is an issue on the repo, asking for a portable version, and discussing this very question as well.

I think just having a field in the Settings View would suffice for this purpose. Plus a parameter or variable in the build scripts and installation files.


#3

Yep. Thats how I got around with Sublime. I use the portable version. But as you said, a setting would suffice (although might require more development effort)


#4

Wouldn’t having an option in settings present a chicken and egg problem?


#5

Well, the setting shouldn’t auto-apply probably. Instead changing it should

  1. Create a copy of the .atom folder at the new location,
  2. then ask you to restart Atom.

…I’m guessing.


#6

Right, but how can it know where to load the settings from before the location setting has been loaded? :slight_smile:


#7

A Default. Just as after installing or building it will use the standard .atom location.
You can then change it to whatever you want as above.

Unless of course we do get an installation parameter or a simple variable to set during the build task. But a default value is still safer.


#8

Maybe via an environment variable. Or via a little file in ~/.atom that tells it where to go.


#9

Regarding making it portable: it could just look in the same folder as the executable first, then if it doesn’t find a .atom folder there, look for ~/.atom instead.

That way, the only thing you need to do to make it portable is copy the .atom folder from your home directory to wherever you put atom.exe.

For now, I’m just using a .atom folder stored on my flash drive that I copy into the home directory of whatever computer I’m using at the time, then delete it (or move it back to the flash drive if I changed any settings) when I’m done.

As for the OP’s problem, if you don’t need it to be portable but need to put the folder elsewhere, you could move the .atom folder wherever you want to keep it, then use a symbolic link to point ~/.atom to the new location.


#10

Clicky clicky:


#11

I think you guys are missing the point. How can i change where the app is installed if i have to install the app first? One of the primary reasons to want to install somewhere else is one cant or wont install to /Program Files…

Like when does not have admin privileges … or room on a drive


#12

Problem

  • application uses settings directory that cannot be changed via environment variable settings

Solution – use symlinks

  • copy the current settings directory to an alternate location
  • delete the settings directory in the default location
  • create a symlink in the default location that points to the alternate location

Rationale

  • Most operating systems support symlinks for directories
  • On linux this is built-in, on windows use sysinternals junction

#13

I think, this is not the best way to handle it. On Windows, junctions could not link to network shares and a symlink with mklink /d requires admin privileges even if I have full access to the directory.


#14

Ubiquitous Bash FakeHome is specifically designed to address this kind of nuisance - confining the application to run in the same apparent home folder as the script. And when that isn’t enough, full, file parameter translated virtualization can run the whole system through a single command.
https://rawgit.com/mirage335/ubiquitous_bash/master/USAGE.html

Expect to see portable Atom support merged directly into Ubiquitous Bash itself. >;)


#15

Launch atom instance contained to “$scriptLib”/app/atom/home . Or a temporary copy thereof. Shells launched from within will see the user “$realHome” directory as home, if the “_setupUbiquitous” hook has been run, adding an entry to “~/.bashrc” .

ubiquitous_bash.sh _atom_edit .
ubiquitous_bash.sh _atom_user .
ubiquitous_bash.sh _atom_config .

An “ops” script may be used to override specific behaviors, including designating any one of these functions to be used as “_atom”.

Fork script included with repository, to enable creation of specialized editors for specific projects or toolchains.

Alternatively, Atom currently supports the “$ATOM_HOME” environment variable, as used by “_atom_config”.