This repository has been archived by the owner on Jun 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Materialize.py
128 lines (119 loc) · 5.61 KB
/
Materialize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import re
import sublime
import sublime_plugin
class ActivateMaterializeThemeCommand(sublime_plugin.TextCommand):
def run(self, action):
names = [
"Material Augmented Reaction",
"Material Behave",
"Material Brogrammer",
"Material Cobalt",
"Material Dracula",
"Material Facebook",
"Material Firewatch",
"Material Flatland",
"Material Glacier",
"Material Monokai Soda",
"Material Monokai",
"Material Oceanic Next",
"Material One Dark",
"Material Primer Light",
"Material Seti",
"Material Solarized Dark",
"Material Solarized Light",
"Material Spaceblack Ocenic",
"Material Spaceblack",
"Material Spacegray Eighties",
"Material Spacegray Light",
"Material Spacegray Mocha",
"Material Spacegray",
"Material Stereokai",
"Material Toy Chest",
"Material Twilight",
"Material Vim Blackboard",
"Material Zenburn",
]
self.themes = [
"Material Augmented Reaction.sublime-theme",
"Material Behave.sublime-theme",
"Material Brogrammer.sublime-theme",
"Material Cobalt.sublime-theme",
"Material Dracula.sublime-theme",
"Material Facebook.sublime-theme",
"Material Firewatch.sublime-theme",
"Material Flatland.sublime-theme",
"Material Glacier.sublime-theme",
"Material Monokai Soda.sublime-theme",
"Material Monokai.sublime-theme",
"Material Oceanic Next.sublime-theme",
"Material One Dark.sublime-theme",
"Material Primer Light.sublime-theme",
"Material Seti.sublime-theme",
"Material Solarized Dark.sublime-theme",
"Material Solarized Light.sublime-theme",
"Material Spaceblack.sublime-theme",
"Material Spaceblack.sublime-theme",
"Material Spacegray Eighties.sublime-theme",
"Material Spacegray Light.sublime-theme",
"Material Spacegray Mocha.sublime-theme",
"Material Spacegray.sublime-theme",
"Material Stereokai.sublime-theme",
"Material Toy Chest.sublime-theme",
"Material Twilight.sublime-theme",
"Material Vim Blackboard.sublime-theme",
"Material Zenburn.sublime-theme",
]
self.schemes = [
"Packages/Materialize/schemes/Material Augmented Reaction.tmTheme",
"Packages/Materialize/schemes/Material Behave.tmTheme",
"Packages/Materialize/schemes/Material Brogrammer.tmTheme",
"Packages/Materialize/schemes/Material Cobalt.tmTheme",
"Packages/Materialize/schemes/Material Dracula.tmTheme",
"Packages/Materialize/schemes/Material Facebook.tmTheme",
"Packages/Materialize/schemes/Material Firewatch.tmTheme",
"Packages/Materialize/schemes/Material Flatland.tmTheme",
"Packages/Materialize/schemes/Material Glacier.tmTheme",
"Packages/Materialize/schemes/Material Monokai Soda.tmTheme",
"Packages/Materialize/schemes/Material Monokai.tmTheme",
"Packages/Materialize/schemes/Material Oceanic Next.tmTheme",
"Packages/Materialize/schemes/Material One Dark.tmTheme",
"Packages/Materialize/schemes/Material Primer Light.tmTheme",
"Packages/Materialize/schemes/Material Seti.tmTheme",
"Packages/Materialize/schemes/Material Solarized Dark.tmTheme",
"Packages/Materialize/schemes/Material Solarized Light.tmTheme",
"Packages/Materialize/schemes/Material Spaceblack Oceanic.tmTheme",
"Packages/Materialize/schemes/Material Spaceblack.tmTheme",
"Packages/Materialize/schemes/Material Spacegray Eighties.tmTheme",
"Packages/Materialize/schemes/Material Spacegray Light.tmTheme",
"Packages/Materialize/schemes/Material Spacegray Mocha.tmTheme",
"Packages/Materialize/schemes/Material Spacegray.tmTheme",
"Packages/Materialize/schemes/Material Stereokai.tmTheme",
"Packages/Materialize/schemes/Material Toy Chest.tmTheme",
"Packages/Materialize/schemes/Material Twilight.tmTheme",
"Packages/Materialize/schemes/Material Vim Blackboard.tmTheme",
"Packages/Materialize/schemes/Material Zenburn.tmTheme",
]
self.view.window().show_quick_panel(names, self.on_done, on_highlight=self.on_highlighted)
def on_done(self, index):
scheme = self.schemes[index]
theme = self.themes[index]
self.set_scheme(scheme)
self.set_theme(theme)
self.save_settings(theme)
def on_highlighted(self, index):
scheme = self.schemes[index]
theme = self.themes[index]
self.set_scheme(scheme)
self.set_theme(theme)
def set_scheme(self, scheme):
self.get_settings().set('color_scheme', scheme)
def set_theme(self, theme):
self.get_settings().set('theme', theme)
def get_settings(self):
return sublime.load_settings('Preferences.sublime-settings')
def save_settings(self, theme):
sublime.save_settings('Preferences.sublime-settings')
sublime.status_message('Materialize: ' + theme)
print('')
print('[Materialize] ' + theme)
print('')