Commit 9012f7df authored by Sergio Costas's avatar Sergio Costas

Added full support for localized color schemes

Updated to version 0.7.0
parent 0351ee2f
## History of versions ##
* Version 0.7.0 (2016-12-24)
* Added full palette support
* Added all palette styles from gnome-terminal
* Added Solarized palette
* Version 0.6.0 (2016-12-17)
* Added a Gnome Shell extension, to allow to use the quake-terminal mode under Wayland with Gnome Shell
* Fixed the top bar (sometimes it didn't show the focus)
......
pkgname=terminus
pkgver=0.6.0
pkgver=0.7.0
pkgrel=1
pkgdesc="A new terminal for XWindows
"
......
......@@ -8,13 +8,14 @@ A new terminal for XWindows (and Wayland)
There are plenty of graphic terminals for linux, so what makes this one different?
First, it allows to split a window in several tiling subwindows, exactly like the old
Terminator terminal. Of course it can create several simultaneous windows, and have
tabs in each window.
Terminator terminal. Of course it can create several simultaneous windows, and allows
to have several tabs in each window.
Second, allows to have an always-available drop-down terminal in all screens, with an
appearance similar to the Quake console, exactly like Guake.
Of course, the Guake-like terminal can be split in tiling subwindows.
Of course, the Guake-like terminal can be split in tiling subwindows, wich is its main
novelty.
Third, it has been written in Vala and uses Gtk3, which allows it to take advantage
of the new characteristics available and to use less resources (both guake and terminator
......@@ -60,15 +61,67 @@ to have it. You can also launch it from a terminal.
Currently the number of options modificable is small, but more will become available.
## Creating new palettes ##
It is very easy to add new palettes to Terminus. Just edit a file with *.color_scheme*
as extension, and place it at */usr/share/terminus* (or */usr/local/share/terminus*,
depending where you installed the binaries) to have it globally available, or at
*~/.local/share/terminus* to make it available only to you.
The format is very simple. Here is an example that defines a foreground/background
color scheme:
name: Orange on black
name[es]: Naranja sobre negro
text_fg: #FECE12
text_bg: #000000
This file will define the *Orange on black* color scheme, that specifies that the
foreground will be orange, and the background will be black. It also specifies the name
translated into spanish.
Another example, this time for a palette scheme:
name: Solarized
palette: #002b36
palette: #073642
palette: #586e75
palette: #657b83
palette: #839496
palette: #93a1a1
palette: #eee8d5
palette: #fdf6e3
palette: #b58900
palette: #cb4b16
palette: #dc322f
palette: #d33682
palette: #6c71c4
palette: #268bd2
palette: #2aa198
palette: #859900
This one defines the *Solarized* palette, with all its 16 colors. Each *palette*
entry defines one color, and they will be inserted in that precise order. There
must be exactly 16 *palette* entries; no more, no less.
You can define in a single file a color scheme and a palette scheme, but they will
be shown in the app as separated elements. This is: if you define in a single file
a color and palette scheme called MYGREATFULLSCHEME, you will find a color scheme
called MYGREATFULLSCHEME in the color scheme list, and it will change only the
foreground/background colors; and you also will find a palette scheme called
MYGREATFULLSCHEME in the palette scheme list, and it will change only the palette
itself, but not the foreground/background colors.
## FAQ ##
Q: I use Gnome-Shell and when I show the Quake terminal, it doesn't get the focus.
A: It seems that installing the "Steal my focus" extension fix it. It can be found at
*Q:* I use Gnome-Shell and when I show the Quake terminal, it doesn't get the focus.
*A:* It seems that installing the "Steal my focus" extension fix it. It can be found at
https://extensions.gnome.org/extension/234/steal-my-focus/
Q: I'm using Wayland, and pressing Alt+F12 (or my keybinding) doesn't show the Quake-like
*Q:* I'm using Wayland, and pressing Alt+F12 (or my keybinding) doesn't show the Quake-like
terminal.
A: That's because Wayland doesn't allow to an application to set its own keybindings.
*A:* That's because Wayland doesn't allow to an application to set its own keybindings.
Fortunately, Terminus includes a Gnome Shell extension that allows to show the Quake-like
terminal. If you have installed Terminus, just exit your session, enter again, and enable
the extension with gnome-tweak-tool.
......@@ -79,6 +132,8 @@ which makes use of the DBus remote control to show and hide the Quake-like termi
In Gnome Shell it is as easy as opening the Settings window, choose the "Keyboard" icon,
and add there the desired hotkey, associating it with "terminus_showhide.sh" program.
*Q:* I translated Terminus, but the color and palette schemes aren't translated. Why?
*A:* You have to also translate the ".color_scheme" files located at data/local.
## Contacting the author ##
......
name: Black on light yellow
name[es]: Negro sobre amarillo claro
text_fg: #000000
text_bg: #FFFFDD
name: Black on white
name[es]: Negro sobre blanco
text_fg: #000000
text_bg: #FFFFFF
name: Dark Solar
name[es]: Solar oscuro
text_fg: #839496
text_bg: #002B36
name: Gray on black
name[es]: Gris sobre negro
text_fg: #C0C0C0
text_bg: #000000
name: Green on black
name[es]: Verde sobre negro
text_fg: #00FF00
text_bg: #000000
name: Light Solar
name[es]: Solar claro
text_fg: #657B83
text_bg: #FDF6E3
name: Linux Console
name[es]: Consola Linux
palette: #000000
palette: #AA0000
palette: #00AA00
......
name: Orange on black
name[es]: Naranja sobre negro
text_fg: #FECE12
text_bg: #000000
name: White on black
name[es]: Blanco sobre negro
text_fg: #FFFFFF
text_bg: #000000
terminus (0.7.0-Debian1) sid; urgency=low
* Added full palette support
* Added all palette styles from gnome-terminal
* Added Solarized palette
-- Sergio Costas Rodriguez <raster@rastersoft.com> Sat, 24 Dec 2016 23:55:00 +0200
terminus (0.6.0-Debian1) sid; urgency=low
* Added a Gnome Shell extension, to allow to use the quake-terminal mode under Wayland with Gnome Shell
......
......@@ -6,7 +6,7 @@ Build-Depends: build-essential, po-debconf, valac, libc6-dev, libatk1.0-dev, lib
Package: terminus
Architecture: any
Version: 0.6.0
Version: 0.7.0
Depends: libatk1.0-0, libglib2.0-0, libcairo2, libgtk-3-0, libpangocairo-1.0-0, libpango-1.0-0, libgdk-pixbuf2.0-0, libcairo-gobject2, libgee-0.8-2, libkeybinder-3.0-0, libvte-2.91-0, lib32z1, libgnutls30, libx11-6, libglib2.0-bin
Description: A new terminal for XWindows
.
terminus (0.7.0-Debian1) sid; urgency=low
* Added full palette support
* Added all palette styles from gnome-terminal
* Added Solarized palette
-- Sergio Costas Rodriguez <raster@rastersoft.com> Sat, 24 Dec 2016 23:55:00 +0200
terminus (0.6.0-Debian1) sid; urgency=low
* Added a Gnome Shell extension, to allow to use the quake-terminal mode under Wayland with Gnome Shell
......
......@@ -6,7 +6,7 @@ Build-Depends: build-essential, po-debconf, valac, libc6-dev, libatk1.0-dev, lib
Package: terminus
Architecture: any
Version: 0.6.0
Version: 0.7.0
Depends: libatk1.0-0, libglib2.0-0, libcairo2, libgtk-3-0, libpangocairo-1.0-0, libpango-1.0-0, libgdk-pixbuf2.0-0, libcairo-gobject2, libgee-0.8-2, libkeybinder-3.0-0, libvte-2.91-0, libgnutls30, libx11-6, libglib2.0-bin
Description: A new terminal for XWindows
.
Name: terminus
Version: 0.6.0
Version: 0.7.0
Release: 1
License: Unknown/not set
Summary: A new terminal for XWindows
......
......@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "terminus")
set (RELEASE_NAME "terminus")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "0.6.0")
set (VERSION "0.7.0")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "0.6.0")
set (VERSION "0.7.0")
add_definitions (${DEPS_CFLAGS})
link_libraries ( ${DEPS_LIBRARIES} )
link_directories ( ${DEPS_LIBRARY_DIRS} )
......
......@@ -19,7 +19,7 @@
using Gtk;
using Gee;
//project version = 0.6.0
//project version = 0.7.0
namespace Terminus {
......@@ -32,6 +32,7 @@ namespace Terminus {
public bool custom;
public string? name;
public HashMap<string, string> name_locale;
public Gdk.RGBA[] palette;
public Gdk.RGBA? text_fg;
public Gdk.RGBA? text_bg;
......@@ -47,6 +48,7 @@ namespace Terminus {
this.palette = {};
this.text_fg = null;
this.text_bg = null;
this.name_locale = new HashMap<string, string> ();
/*this.bold = null;
this.cursor_fg = null;
this.cursor_bg = null;
......@@ -176,14 +178,25 @@ namespace Terminus {
}
var pos = line.index_of_char(':');
if (pos == -1) {
GLib.stderr.printf("Error: palette file %s has unrecognized content at line %d\n",filename,line_n);
GLib.stderr.printf(_("Error: palette file %s has unrecognized content at line %d\n"),filename,line_n);
has_error = true;
continue;
}
var command = line.substring(0,pos).strip();
var sdata = line.substring(pos+1).strip();
if (command == "name") {
this.name = _(sdata);
this.name = sdata;
continue;
}
if (command.has_prefix("name[")) {
var p = command.index_of_char(']');
if (p == -1) {
GLib.stderr.printf(_("Error: palette file %s has opens a bracket at line %d without closing it\n"),filename,line_n);
has_error = true;
continue;
}
var lang = command.substring(5,p-5);
this.name_locale[lang] = sdata;
continue;
}
if (sdata[0] != '#') {
......@@ -191,7 +204,7 @@ namespace Terminus {
}
var data = Gdk.RGBA();
if (!data.parse(sdata)) {
GLib.stderr.printf("Error: palette file %s has an unrecognized color at line %d\n",filename,line_n);
GLib.stderr.printf(_("Error: palette file %s has an unrecognized color at line %d\n"),filename,line_n);
has_error = true;
continue;
}
......@@ -201,7 +214,7 @@ namespace Terminus {
this.palette += data;
} else {
if (!has_more) {
GLib.stderr.printf("Warning: palette file %s has more than 16 colors\n",filename);
GLib.stderr.printf(_("Warning: palette file %s has more than 16 colors\n"),filename);
}
has_more = true;
}
......@@ -228,7 +241,7 @@ namespace Terminus {
this.bold = data;
break;*/
default:
GLib.stderr.printf("Error: palette file %s has unrecognized content at line %d\n",filename,line_n);
GLib.stderr.printf(_("Error: palette file %s has unrecognized content at line %d\n"),filename,line_n);
has_error = true;
break;
}
......@@ -238,19 +251,19 @@ namespace Terminus {
}
if ((this.palette.length >0) && (this.palette.length < 16)) {
GLib.stdout.printf("Error: Palette file %s has less than 16 colors\n",filename);
GLib.stdout.printf(_("Error: Palette file %s has less than 16 colors\n"),filename);
has_error = true;
}
if (this.name == null) {
GLib.stdout.printf("Error: Palette file %s has no palette name\n",filename);
if ((this.name == null) || (this.name == "")) {
GLib.stdout.printf(_("Error: Palette file %s has no palette name\n"),filename);
has_error = true;
}
if ((this.text_bg == null) && (this.text_fg != null)) {
GLib.stdout.printf("Error: Palette file %s has text_fg color but not text_bg color\n",filename);
GLib.stdout.printf(_("Error: Palette file %s has text_fg color but not text_bg color\n"),filename);
has_error = true;
}
if ((this.text_bg != null) && (this.text_fg == null)) {
GLib.stdout.printf("Error: Palette file %s has text_bg color but not text_fg color\n",filename);
GLib.stdout.printf(_("Error: Palette file %s has text_bg color but not text_fg color\n"),filename);
has_error = true;
}
/*if ((this.cursor_fg == null) && (this.cursor_bg != null)) {
......@@ -291,6 +304,12 @@ namespace Terminus {
has_error = true;
}
}*/
foreach(var locale in GLib.Intl.get_language_names()) {
if (this.name_locale.has_key(locale)) {
this.name = this.name_locale.get(locale);
break;
}
}
return has_error;
}
}
......@@ -303,7 +322,7 @@ namespace Terminus {
private Terminus.Base? guake_terminal;
private Terminus.Window? guake_window;
public Terminuspalette[] palettes;
public Gee.List<Terminuspalette> palettes;
public Terminus.Properties window_properties;
......@@ -322,13 +341,15 @@ namespace Terminus {
bool launch_terminal = true;
bool launch_guake;
var palette = new Terminuspalette();
palette.custom = true;
palette.name = _("Custom colors");
this.palettes += palette;
this.palettes = new Gee.ArrayList<Terminuspalette>();
this.read_color_schemes(GLib.Path.build_filename(Constants.DATADIR,"terminus"));
this.read_color_schemes(GLib.Path.build_filename(Environment.get_home_dir(),".local","share","terminus"));
var palette = new Terminuspalette();
palette.custom = true;
palette.name = _("Custom colors");
this.palettes.sort(this.ComparePalettes);
this.palettes.add(palette);
this.window_properties = new Terminus.Properties();
......@@ -365,6 +386,19 @@ namespace Terminus {
}
}
public int ComparePalettes(Terminuspalette a, Terminuspalette b) {
if (a.name < b.name) {
return -1;
} else {
if (a.name > b.name) {
return 1;
} else {
return 0;
}
}
}
void read_color_schemes(string foldername) {
try {
......@@ -376,7 +410,7 @@ namespace Terminus {
while ((file_info = enumerator.next_file ()) != null) {
var palette = new Terminuspalette();
if (!palette.readpalette(GLib.Path.build_filename(foldername,file_info.get_name()))) {
this.palettes += palette;
this.palettes.add(palette);
}
}
} catch (Error e) {
......
......@@ -13,7 +13,7 @@ custom: terminus_gnome_shell/metadata.json share/gnome-shell/extensions/showTerm
*vapidir: src/vapidir
vala_binary: src/terminus
*version: 0.6.0
*version: 0.7.0
use_gresource: extras_gresource_xml
vala_vapi: checkwayland.vapi
*vala_package: posix
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment