Direlynx
Direlynx

Reputation: 23

Configure atom package options from command line?

I'm writing a shell script I can run on a new machine to install my apps, set preferences, arrange dock, and add homebrew packages, and I'd like to be able to configure atom packages within the script instead of manually. Is this possible?

Edit: Also I'd like to change the theme from command line, is that possible?

cd ~/.atom touch init.coffee echo "atom.config.set('core.themes', ['THEME_HERE', 'SYNTAX_THEME_HERE'])" >> init.coffee

Upvotes: 2

Views: 739

Answers (1)

Michelle Tilley
Michelle Tilley

Reputation: 159095

Atom configuration settings are stored as CSON text in config.cson in the .atom directory. So, for example, if you ran

atom.config.set('core.themes', ['THEME_HERE', 'SYNTAX_THEME_HERE'])

from inside Atom, in the config.cson file, you would see:

"*":
  core:
    themes: [
      "THEME_HERE"
      "SYNTAX_THEME_HERE"
    ]

So, you can write directly to this file from your shell script to configure Atom. You can also change config.cson to config.json and use JSON (instead of CSON) to configure the editor, which can make it easier to use things like jq to work with the file.

Upvotes: 2

Related Questions