Last active
August 29, 2015 14:24
-
-
Save t9md/e1a8597ccd7225080e3b to your computer and use it in GitHub Desktop.
Automatically swich theme in Atom whether it is in dev mode or based on project dir name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use this in your init.coffee | |
themeSets = | |
"vim-mode": ["atom-light-ui", "atom-light-syntax"] | |
"atom": ["atom-dark-ui", "monokai"] | |
"_devMode": ["one-dark-ui", "one-dark-syntax"] | |
"_default": ["atom-dark-ui", "base16-tomorrow-dark-theme"] | |
path = require 'path' | |
autoSwitchTheme = -> | |
theme = null | |
if atom.inDevMode() | |
theme = themeSet['_devMode'] | |
else | |
for _path in atom.project.getPaths() | |
break if theme = themeSets[path.basename(_path)] | |
theme = "_default" unless theme | |
atom.config.set('core.themes', theme) | |
autoSwitchTheme() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment