Skip to content

Instantly share code, notes, and snippets.

@ezuk
Forked from russelldavies/hterm_solarized.js
Last active September 15, 2015 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezuk/5b548f70dbd37e76aa5d to your computer and use it in GitHub Desktop.
Save ezuk/5b548f70dbd37e76aa5d to your computer and use it in GitHub Desktop.
// Run in the JavaScript console of the hterm browser window
// Clear all existing settings - you probably don't want to do this.
// Preferences are now stored in "chrome.storage.sync" instead of
// "window.localStorage" so if you clear your preferences the changes
// will be propagated to other devices.
//term_.prefs_.storage.clear();
var htermProfiles = [
// Solarized Dark
{
'name': 'solarized-dark',
'prefs': {
'background-color': '#002b36',
'foreground-color': '#839496',
'cursor-color': 'rgba(131, 148, 150, 0.5)',
},
},
// Solarized Light
{
'name': 'solarized-light',
'prefs': {
'background-color': '#fdf6e3',
'foreground-color': '#657b83',
'cursor-color': 'rgba(101, 123, 131, 0.5)',
},
},
];
htermProfiles.forEach(function(profile) {
term_.setProfile(profile.name);
term_.prefs_.resetAll();
for (var name in profile.prefs) {
term_.prefs_.set(name, profile.prefs[name]);
}
term_.prefs_.set('color-palette-overrides', ['#073642', '#dc322f',
'#859900', '#b58900', '#268bd2', '#d33682', '#2aa198', '#eee8d5',
'#002b36', '#cb4b16', '#586e75', '#657b83', '#839496', '#6c71c4',
'#93a1a1', '#fdf6e3']);
term_.prefs_.set('font-size', 14);
term_.prefs_.set('font-family', 'Droid Sans Mono for Powerline');
//term_.prefs_.set('enable-bold', false);
//term_.prefs_.set('font-smoothing', 'subpixel-antialiased');
});
// From then on to set the profile at will: `term_.setProfile('profile_name)`,
// e.g.: `term_.setProfile('solarized-dark')`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment