Permalink
Browse files

XFCE4 terminal support.

  • Loading branch information...
1 parent 5044e09 commit 4ced1c54e32b9d0ae68e4a2a1b8491495c7f2e2b @ciembor committed Aug 27, 2012
Showing with 50 additions and 2 deletions.
  1. +3 −0 README.md
  2. +0 −1 images/images
  3. +3 −0 index.html
  4. +44 −1 js/main.js
View
@@ -14,6 +14,9 @@ Copy the generated text to `~/.Xresources` file (you may have to create it) and
* __Konsole and Yakuake:__
Put the generated file to `~/.kde/share/apps/konsole/NAME-OF-SCHEME.colorscheme` and restart the terminal.
+* __XFCE4 Terminal:__
+Backup `~/.config/Terminal/terminalrc` file and replace it with generated text. Take into account that this file contains all XFCE4 Terminal settings, not only color scheme.
+
* __Other terminals:__
Generate one of the supported formats and copy hex values into the configuration file (or tool) of your terminal.
View
View
@@ -108,6 +108,9 @@
<li>
<p>konsole / yakuake <a href="#" target="_blank" id="konsole-button" class="get-scheme-link">*.colorscheme</a>
</li>
+ <li>
+ <p>xfce4 terminal <a href="#" target="_blank" id="xfce-terminal-button" class="get-scheme-link">terminalrc</a>
+ </li>
</ul>
</div>
View
@@ -524,6 +524,48 @@ _4bit = function() {
});
+ var SchemeXfceTerminalView = Backbone.View.extend({
+
+ model: scheme,
+
+ initialize: function() {
+ _.bindAll(this, 'render');
+ var that = this;
+ $('#xfce-terminal-button').hover(function() {
+ that.render();
+ });
+ $('#xfce-terminal-button').focus(function() {
+ that.render();
+ });
+ },
+
+ render: function() {
+ var that = this;
+ var terminalrc = '[Configuration]\n';
+ var counter = 1;
+
+ // special colors
+ terminalrc += 'ColorBackground=' + that.model.get('colors')['background'] + '\n';
+ terminalrc += 'ColorForeground=' + that.model.get('colors')['foreground'] + '\n';
+ terminalrc += 'ColorCursor=' + that.model.get('colors')['foreground'] + '\n';
+
+ // standard colors
+ _.each(COLOR_NAMES, function(name) {
+ var number = counter / 2 + 0.5;
+
+ if (0 === name.indexOf('bright_')) {
+ number += 7.5;
+ }
+
+ terminalrc += 'ColorPalette' + number + '=' + that.model.get('colors')[name] + '\n';
+ counter += 1;
+ });
+
+ $('#xfce-terminal-button').attr('href', 'data:text/plain,' + encodeURIComponent(terminalrc));
+ }
+
+ });
+
var ControlsView = Backbone.View.extend({
el: $('#controls'),
@@ -681,6 +723,7 @@ _4bit = function() {
var schemeCSSView = new SchemeCSSView();
var schemeXresourcesView = new SchemeXresourcesView();
var schemeKonsoleView = new SchemeKonsoleView();
+ var schemeXfceTerminalView = new SchemeXfceTerminalView();
var controlsView = new ControlsView();
// basic layout behaviour /////////////////////////////
@@ -703,7 +746,7 @@ _4bit = function() {
$('#app').animate({opacity: 1}, 700);
$("#get-scheme-button").click(function(button) {
$("#dialog-modal").dialog({
- height: 192,
+ height: 90 + 50 * $('.get-scheme-link').length,
width: 450,
modal: true,
draggable: false,

0 comments on commit 4ced1c5

Please sign in to comment.