Last active
May 20, 2019 17:54
-
-
Save davidhamann/c8515a3aafe35b9a3207ae354d744636 to your computer and use it in GitHub Desktop.
Quick and dirty way to switch vscode theme between light and dark. Put it into crontab for auto switch day/night.
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
#!/usr/bin/env python | |
import json | |
path = '/Users/your_user/Library/Application Support/Code/User/settings.json' | |
theme_day = 'Default Light+' | |
theme_night = 'Default Dark+' | |
with open(path, 'r') as settings_file: | |
data = json.load(settings_file) | |
data['workbench.colorTheme'] = theme_day if data['workbench.colorTheme'] == theme_night else theme_night | |
with open(path, 'w') as settings_file: | |
json.dump(data, settings_file,indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you don't mind, have a look at my extension ThemeSwitch for a less dirty way of doing this.