Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Move .atom config to $XDG_CONFIG_HOME on linux #2199

Closed

Description

@aviau

From feedesktop.org:

$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

Source: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Thanks!

Activity

  1. changed the title [-]Move config to $XDG_CONFIG_HOME on linux[/-] [+]Move .atom to $XDG_CONFIG_HOME on linux[/+] on May 13, 2014
  2. changed the title [-]Move .atom to $XDG_CONFIG_HOME on linux[/-] [+]Move .atom config to $XDG_CONFIG_HOME on linux[/+] on May 13, 2014
  3. cgtx commented on May 14, 2014

    @cgtx

    This is important to me as well.

  4. cadesalaberry commented on May 14, 2014

    @cadesalaberry

    👍

  5. malko commented on May 15, 2014

    @malko

    👍

  6. alexwhitman commented on May 15, 2014

    @alexwhitman

    So this should be fairly straight forward by updating https://github.com/atom/atom/blob/master/src/atom.coffee#L90 - Something like

      @getConfigDirPath: ->
        if process.platform is 'win32'
          dir = process.env.APPDATA
        else if process.platform is 'darwin'
          # osx path
        else
          dir = if process.env.XDG_CONFIG_HOME then process.env.XDG_CONFIG_HOME else '~/.config'
        @configDirPath ?= fs.absolute(dir + '/atom')

    which will use $XDG_CONFIG_HOME/atom if $XDG_CONFIG_HOME is set, otherwise fall back to ~/.config/atom.

    I'm not sure what the equivalent would be for OSX.

  7. pritambaral commented on May 16, 2014

    @pritambaral
    Contributor

    It would need to be updated in the docs. What do we replace ~/.atom with in documentation? A short word would be nice.

    I'm in the process of doing this. If anybody has a suggestion regarding darwin's location, please tell. For now, I'm leaving it as ~/.atom.

  8. alexwhitman commented on May 16, 2014

    @alexwhitman

    Looks like OS X should be in /Users/<username>/Library/Preferences. Username can be retrieved with https://www.npmjs.org/package/username

  9. pritambaral commented on May 16, 2014

    @pritambaral
    Contributor

    The build process also utilises ~/.atom as a cache. Better move to $XDG_CACHE_HOME while we are at it.

  10. pritambaral commented on May 16, 2014

    @pritambaral
    Contributor

    @alexwhitman I see that https://www.npmjs.org/package/username looks at various system env variables.
    BTW, fs-plus already has getHomeDirectory() and .absolute('~/Library/Preferences'). Can you test the latter?

  11. pritambaral commented on May 16, 2014

    @pritambaral
    Contributor

    Ah, stackoverflow is dead here. Apparently they updated all their BGP routes today. Anyway, I'm going to stay with the status quo on OS X: ~/.atom, for now.

  12. rnhmjoj commented on Aug 28, 2014

    @rnhmjoj

    The status quo on OSX it's not the dotfile. OSX applications use ~/Library/Preferences/[identifier].plist to store preferences in text format. One file only.
    Other data goes into ~/Library/Application Support/[app-name]/
    Since .atom stores not only preferences but also packages repo and caches ~/Library/Application Support/is the most appropriate.
    See Apple docs: 1 2

  13. kevinsawicki commented on Feb 4, 2015

    @kevinsawicki
    Contributor

    There is now full support for configuring the config location via the ATOM_HOME environment variable via #5385.

    I'm going to close this issue out since changing the default location at this point is unlikely given how many Atom installs are already out there.

  14. aviau commented on Feb 4, 2015

    @aviau
    Author

    So Atom will never ever respect the freedesktop standard? Its a shame, 1.0 wasn't released yet. Now should be the moment to make things right.

  15. kevinsawicki commented on Feb 4, 2015

    @kevinsawicki
    Contributor

    Switching to this standard would require reworking more than just one path since XDG_CACHE_HOME should be used for Atom's compile cache, and XDG_RUNTIME_DIR should probably be used for installed packages & themes.

    Currently these are all stored under ~/.atom. Having all of them co-located makes it incredibly easy to backup, transfer, and clean out your machine of all Atom related files. Also using the same path on all platforms makes Atom predictable for people using multiple platforms.

  16. cgtx commented on Feb 4, 2015

    @cgtx

    One of the benefits of XDG Base Directory Specification is that a user can back up configurations and data, but not cache. Forcing all of Atom's data under one directory means that it is much more difficult to do this.

  17. vially commented on Feb 6, 2015

    @vially

    using the same path on all platforms makes Atom predictable for people using multiple platforms

    I think people using multiple platforms are accustomed with different operating systems having different file system layouts. If we were to take this reasoning to the extreme you might be tempted to install the Atom binary in a "/usr/Program Files" directory while on a Linux/Mac machine and I don't think there's anyone who would argue that that's just plain wrong.

    Given that Atom is still not considered stable I think it's still not too late to change this to support the XDG standard. And while I agree that doing it properly requires a little bit more work to be fully compliant, I think that if the Atom team shows interest in supporting the standard, someone might be able to come up with a pull request to implement it.

  18. malko commented on Feb 6, 2015

    @malko

    👍
    I'm working on different platforms and i'm always looking first for platform specific path in first place.

  19. Dremora commented on Feb 17, 2015

    @Dremora

    Changing default location should never be an issue as long as it's done in a backwards-compatible way, no matter how large the user base is.
    A common workaround is to define not one, but multiple config paths, and pick up the first existing one. This list of paths should be OS-specific, with $ATOM_HOME taking the precedence over everything else. Then, if the config directory is nowhere to be found, it should be created at the first OS-specific location.

    I've noticed, however, that on OS X, the configuration is spread across two directories — ~/.atom and ~/Library/Application Support/Atom. The latter seems to be used for blink-specific files, while the earlier is for user configuration. This unfortunately doesn't help, because ~/Library/Application Support/Atom is the default location for non-plist configuration on OS X, and it's the one where ~/.config should go. Looks like the Linux version has an additional directory ~/.config/Atom-Shell which is likely the same (strangely enough, it's called Atom, not Atom-Shell on OS X).

  20. rbellamy commented on Mar 29, 2015

    @rbellamy

    I'm on Linux (Arch) and have both $ATOM_HOME/.atom (because I set it in my .profile to $XDG_CONFIG_HOME/.atom) and ~/.config/Atom (NOT ~/.config/Atom-Shell).

  21. colemickens commented on Jun 26, 2015

    @colemickens

    I also have .atom and .config/Atom. Is one of them old now? Looking at their contents, they look quite different.

    ls ~/.config/Atom
    Cache  Cookies  Cookies-journal  DevTools Extensions  GPUCache  Local Storage
    
    ls .atom/
    compile-cache  config.cson  nohup.out  packages  storage  terminal-commands.json
    

    Ugh, can't believe this was closed... it should be done the right way. ATOM_HOME is like a slap in the fact to the entire point of XDG.

  22. lock commented on Jan 21, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  23. locked as resolved and limited conversation to collaborators on Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlinux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions