From 79d569d55b5f635785032f9f44ab57b93cd76846 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Wed, 30 Jan 2013 15:30:10 -0800 Subject: [PATCH 1/9] rename atom.coffee to user.coffee --- .atom/{atom.coffee => user.coffee} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .atom/{atom.coffee => user.coffee} (100%) diff --git a/.atom/atom.coffee b/.atom/user.coffee similarity index 100% rename from .atom/atom.coffee rename to .atom/user.coffee From 0233b4a53eecff7bfe96aeb6cea2b914b178e230 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Wed, 30 Jan 2013 15:30:18 -0800 Subject: [PATCH 2/9] add .atom/user.css file --- .atom/user.css | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .atom/user.css diff --git a/.atom/user.css b/.atom/user.css new file mode 100644 index 000000000..f53057581 --- /dev/null +++ b/.atom/user.css @@ -0,0 +1,8 @@ +// User styles +.tree-view { + +} + +.editor { + +} \ No newline at end of file From 228c9ff5225467331053ee782bf3838592f20410 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Wed, 30 Jan 2013 15:33:52 -0800 Subject: [PATCH 3/9] update readme to point to user.coffee instead of atom.coffee --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f6e23611e..04459faa3 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Requirements Atom is installed! Type `atom [path]` from the commmand line or find it in `/Applications/Atom.app` ## Your ~/.atom Directory -A basic ~/.atom directory is installed when you run `rake install`. Take a look at ~/.atom/atom.coffee for more information. +A basic ~/.atom directory is installed when you run `rake install`. Take a look at ~/.atom/user.coffee for more information. ## Basic Keyboard shortcuts Atom doesn't have much in the way of menus yet. Use these keyboard shortcuts to @@ -53,7 +53,7 @@ Most default OS X keybindings also work. ## Init Script -Atom will require `~/.atom/atom.coffee` whenever a window is opened or reloaded if it is present in your +Atom will require `~/.atom/user.coffee` whenever a window is opened or reloaded if it is present in your home directory. This is a rudimentary jumping off point for your own customizations. ## Command Panel From 389ecc0b4ae807bc94e7bd5072f40aefda7be249 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Wed, 30 Jan 2013 15:34:26 -0800 Subject: [PATCH 4/9] copy over user.coffee in rake task --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index e6adbba94..bd693df3f 100644 --- a/Rakefile +++ b/Rakefile @@ -80,7 +80,7 @@ task "create-dot-atom" do `rm -rf "#{DOT_ATOM_PATH}"` `mkdir "#{DOT_ATOM_PATH}"` - `cp "#{dot_atom_template_path}/atom.coffee" "#{DOT_ATOM_PATH}"` + `cp "#{dot_atom_template_path}/user.coffee" "#{DOT_ATOM_PATH}"` `cp "#{dot_atom_template_path}/packages" "#{DOT_ATOM_PATH}"` `cp -r "#{ATOM_SRC_PATH}/themes" "#{DOT_ATOM_PATH}"` `cp "#{ATOM_SRC_PATH}/vendor/themes/IR_Black.tmTheme" "#{DOT_ATOM_PATH}/themes"` From 82f1fb44200f8f109d4adf057878ebe5f2e548b4 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Wed, 30 Jan 2013 15:34:38 -0800 Subject: [PATCH 5/9] load user.coffee from .atom directory --- src/app/config.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/config.coffee b/src/app/config.coffee index bf35eff63..26efbd674 100644 --- a/src/app/config.coffee +++ b/src/app/config.coffee @@ -4,7 +4,7 @@ EventEmitter = require 'event-emitter' configDirPath = fs.absolute("~/.atom") configJsonPath = fs.join(configDirPath, "config.json") -userInitScriptPath = fs.join(configDirPath, "atom.coffee") +userInitScriptPath = fs.join(configDirPath, "user.coffee") bundledPackagesDirPath = fs.join(resourcePath, "src/packages") bundledThemesDirPath = fs.join(resourcePath, "themes") vendoredPackagesDirPath = fs.join(resourcePath, "vendor/packages") From 95d7c89ec52dab8cf677ff0bf46b0e3d7839b41b Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Wed, 30 Jan 2013 16:00:45 -0800 Subject: [PATCH 6/9] load styles from ~/.atom/user.css --- src/app/atom.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/atom.coffee b/src/app/atom.coffee index 455382926..43c4d942d 100644 --- a/src/app/atom.coffee +++ b/src/app/atom.coffee @@ -7,6 +7,8 @@ LoadTextMatePackagesTask = require 'load-text-mate-packages-task' messageIdCounter = 1 originalSendMessageToBrowserProcess = atom.sendMessageToBrowserProcess +configDirPath = fs.absolute("~/.atom") +userStylePath = fs.join(configDirPath, "user.css") _.extend atom, exitWhenDone: window.location.params.exitWhenDone @@ -53,10 +55,15 @@ _.extend atom, themeNames = config.get("core.themes") ? ['Atom - Dark', 'IR_Black'] themeNames = [themeNames] unless _.isArray(themeNames) @loadTheme(themeName) for themeName in themeNames + @loadUserStyles() loadTheme: (name) -> @loadedThemes.push Theme.load(name) + loadUserStyles: -> + if fs.exists(userStylePath) + applyStylesheet(userStylePath, fs.read(userStylePath), 'userTheme') + getAtomThemeStylesheets: -> themeNames = config.get("core.themes") ? ['Atom - Dark', 'IR_Black'] themeNames = [themeNames] unless _.isArray(themeNames) From e5bd097592aa7c5987d341ceb678f7b78c354e6b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 31 Jan 2013 09:41:40 -0800 Subject: [PATCH 7/9] Use configDirPath exposed by global config object --- src/app/atom.coffee | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/atom.coffee b/src/app/atom.coffee index 43c4d942d..4630eb6fc 100644 --- a/src/app/atom.coffee +++ b/src/app/atom.coffee @@ -7,8 +7,6 @@ LoadTextMatePackagesTask = require 'load-text-mate-packages-task' messageIdCounter = 1 originalSendMessageToBrowserProcess = atom.sendMessageToBrowserProcess -configDirPath = fs.absolute("~/.atom") -userStylePath = fs.join(configDirPath, "user.css") _.extend atom, exitWhenDone: window.location.params.exitWhenDone @@ -55,14 +53,15 @@ _.extend atom, themeNames = config.get("core.themes") ? ['Atom - Dark', 'IR_Black'] themeNames = [themeNames] unless _.isArray(themeNames) @loadTheme(themeName) for themeName in themeNames - @loadUserStyles() + @loadUserStylesheet() loadTheme: (name) -> @loadedThemes.push Theme.load(name) - loadUserStyles: -> - if fs.exists(userStylePath) - applyStylesheet(userStylePath, fs.read(userStylePath), 'userTheme') + loadUserStylesheet: -> + userStylesheetPath = fs.join(config.configDirPath, 'user.css') + if fs.isFile(userStylesheetPath) + applyStylesheet(userStylesheetPath, fs.read(userStylesheetPath), 'userTheme') getAtomThemeStylesheets: -> themeNames = config.get("core.themes") ? ['Atom - Dark', 'IR_Black'] From 30103b66fcefd45ab6050983d5c61794558b3557 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Thu, 31 Jan 2013 10:18:25 -0800 Subject: [PATCH 8/9] move old atom.coffee to user.coffee on rake install if it exists --- Rakefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index bd693df3f..01db92806 100644 --- a/Rakefile +++ b/Rakefile @@ -76,11 +76,24 @@ task "create-dot-atom" do dot_atom_template_path = ATOM_SRC_PATH + "/.atom" replace_dot_atom = false - next if File.exists?(DOT_ATOM_PATH) + + if File.exists?(DOT_ATOM_PATH) + user_config = "#{DOT_ATOM_PATH}/user.coffee" + old_user_config = "#{DOT_ATOM_PATH}/atom.coffee" + + if File.exists?(old_user_config) + `mv #{old_user_config} #{user_config}` + puts "\033[32mRenamed #{old_user_config} to #{user_config}\033[0m" + end + + next + end `rm -rf "#{DOT_ATOM_PATH}"` `mkdir "#{DOT_ATOM_PATH}"` + `cp "#{dot_atom_template_path}/user.coffee" "#{DOT_ATOM_PATH}"` + `cp "#{dot_atom_template_path}/user.css" "#{DOT_ATOM_PATH}"` `cp "#{dot_atom_template_path}/packages" "#{DOT_ATOM_PATH}"` `cp -r "#{ATOM_SRC_PATH}/themes" "#{DOT_ATOM_PATH}"` `cp "#{ATOM_SRC_PATH}/vendor/themes/IR_Black.tmTheme" "#{DOT_ATOM_PATH}/themes"` From 2982c5e51a304ca91f9efb8c12a0ffd895555ea7 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Thu, 31 Jan 2013 10:22:36 -0800 Subject: [PATCH 9/9] need -r when copying packages directory --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 01db92806..2a14471ac 100644 --- a/Rakefile +++ b/Rakefile @@ -94,7 +94,7 @@ task "create-dot-atom" do `cp "#{dot_atom_template_path}/user.coffee" "#{DOT_ATOM_PATH}"` `cp "#{dot_atom_template_path}/user.css" "#{DOT_ATOM_PATH}"` - `cp "#{dot_atom_template_path}/packages" "#{DOT_ATOM_PATH}"` + `cp -r "#{dot_atom_template_path}/packages" "#{DOT_ATOM_PATH}"` `cp -r "#{ATOM_SRC_PATH}/themes" "#{DOT_ATOM_PATH}"` `cp "#{ATOM_SRC_PATH}/vendor/themes/IR_Black.tmTheme" "#{DOT_ATOM_PATH}/themes"` end