Permalink
Browse files

Create Widget.sublime-settings in User folder, set to current theme

  • Loading branch information...
1 parent da4215b commit 434b17e47d22b94e59c51d441733e1f5ccc096ff @doublerebel doublerebel committed Sep 29, 2012
Showing with 65 additions and 0 deletions.
  1. +28 −0 ColorConsole.py
  2. +6 −0 Default.sublime-commands
  3. +31 −0 Main.sublime-menu
View
@@ -0,0 +1,28 @@
+import os
+import sublime, sublime_plugin
+
+
+class ColorConsoleCommand(sublime_plugin.WindowCommand):
+ def run(self):
+ widgetSettings = self.createNewWidgetSettings()
+ widgetSettingsLocation = os.path.join(sublime.packages_path(), "User", "Widget.sublime-settings")
+ text_file = open(widgetSettingsLocation, "w")
+ text_file.write(widgetSettings)
+ text_file.close()
+ view = self.window.open_file(widgetSettingsLocation)
+
+ def createNewWidgetSettings(self):
+ base_settings = sublime.load_settings("Base File.sublime-settings")
+ current_theme = base_settings.get("color_scheme")
+
+ widgetSettings = """{
+ "syntax": \""""
+ widgetSettings += os.path.join(sublime.packages_path(), "ColorConsole", "Console.tmLanguage")
+ widgetSettings += """\",
+ "color_scheme": \""""
+ widgetSettings += current_theme
+ widgetSettings += """\"
+}
+"""
+ return widgetSettings
+
View
@@ -0,0 +1,6 @@
+[
+ {
+ "caption": "Color Console: Enable",
+ "command": "color_console"
+ }
+]
View
@@ -0,0 +1,31 @@
+[
+ {
+ "mnemonic": "n",
+ "caption": "Preferences",
+ "id": "preferences",
+ "children": [
+ {
+ "mnemonic": "P",
+ "caption": "Package Settings",
+ "id": "package-settings",
+ "children": [
+ {
+ "caption": "Color Console",
+ "children": [
+ {
+ "caption": "Settings \u2013 User",
+ "args": {
+ "file": "${packages}/User/Widget.sublime-settings"
+ },
+ "command": "open_file"
+ },
+ {
+ "caption": "-"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]

0 comments on commit 434b17e

Please sign in to comment.