Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jugyo
committed
Aug 31, 2012
0 parents
commit a2db13a
Showing
5 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pyc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{ "keys": ["ctrl+super+shift+r"], "command": "random_theme" } | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{ "caption": "RandomTheme", "command": "random_theme" } | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
RandomTheme | ||
==== | ||
|
||
Sublime Text 2 plugin that changes the theme randomly. | ||
ランダムにテーマを変更する崇高なテキスト2プラグイン。(Google Translate) | ||
|
||
Synopsis | ||
---- | ||
|
||
Default.sublime-commands: | ||
|
||
[ | ||
{ "caption": "RandomTheme", "command": "random_theme" } | ||
] | ||
|
||
Default (OSX).sublime-keymap: | ||
|
||
[ | ||
{ "keys": ["ctrl+super+shift+r"], "command": "random_theme" } | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import sublime, sublime_plugin | ||
import os | ||
import random | ||
|
||
class RandomThemeCommand(sublime_plugin.TextCommand): | ||
def run(self, edit): | ||
settings = sublime.load_settings('Preferences.sublime-settings') | ||
current_theme = settings.get('color_scheme') | ||
files = os.listdir("%s/%s" % (sublime.packages_path(), 'Color Scheme - Default')) | ||
themes = [t for t in files if not t.endswith('.cache') and not current_theme.endswith(t)] | ||
new_theme = random.choice(themes) | ||
theme_path = "Packages/Color Scheme - Default/%s" % new_theme | ||
settings.set('color_scheme', theme_path) | ||
sublime.save_settings('Preferences.sublime-settings') | ||
sublime.status_message("Theme changed: '%s' => '%s'" % (current_theme, new_theme)) |