Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Save the generated file with `.reg` extension and double click it.
* __Terminator:__
Copy lines within the [profiles] section of the generated configuration file to ~/.config/terminator/config file.

* __Termite:__
Copy lines within the [colors] section of the generated configuration file into your `~/.config/termite/config` file.

* __Other terminals:__
Generate one of the supported formats and copy hex values into the configuration file (or tool) of your terminal.

Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ <h2>Advanced</h2>
<li>
<p>terminator <a href="#" target="_blank" id="terminator-button" class="get-scheme-link">config</a>
</li>
<li>
<p>termite <a href="#" target="_blank" id="termite-button" class="get-scheme-link">config</a>
</li>
</ul>
</div>

Expand Down
43 changes: 43 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,48 @@ _4bit = function() {
}
});

var SchemeTermiteView = Backbone.View.extend({

model: scheme,

initialize: function() {
_.bindAll(this, 'render');
var that = this;
$('#termite-button').hover(function() {
that.render();
});
$('#termite-button').focus(function() {
that.render();
});
},

render: function() {
var that = this;
var config = '[colors]\n';
var counter = 0;

// special colors
config += 'background=' + that.model.get('colors')['background'] + '\n';
config += 'foreground=' + that.model.get('colors')['foreground'] + '\n';
config += 'cursor=' + that.model.get('colors')['foreground'] + '\n';

// standard colors
_.each(COLOR_NAMES, function(name) {
var number = counter / 2;

if (0 === name.indexOf('bright_')) {
number += 7.5;
}

config += 'color' + number + '=' + that.model.get('colors')[name] + '\n';
counter += 1;
});

$('#termite-button').attr('href', 'data:text/plain,' + encodeURIComponent(config));
}

});

var ControlsView = Backbone.View.extend({

el: $('#controls'),
Expand Down Expand Up @@ -1055,6 +1097,7 @@ _4bit = function() {
var schemeXfceTerminalView = new SchemeXfceTerminalView();
var schemePuttyView = new SchemePuttyView();
var schemeTerminatorView = new SchemeTerminatorView();
var schemeTermiteView = new SchemeTermiteView();
var controlsView = new ControlsView();

// basic layout behaviour /////////////////////////////
Expand Down