Commit ab928861 authored by Sergio Costas's avatar Sergio Costas

Fixed some startup bugs when launching a new terminus from a .desktop launcher

parent c3051741
## History of versions ##
* Version 0.8.0 (2017-08-01)
* Fixed some startup bugs
* Version 0.7.0 (2016-12-24)
* Added full palette support
* Added all palette styles from gnome-terminal
......
pkgname=terminus
pkgver=0.7.0
pkgver=0.8.0
pkgrel=1
pkgdesc="A new terminal for XWindows
"
......
......@@ -20,11 +20,7 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/terminus.desktop DESTINATION ${CMAKE_I
if( NOT ( ${CMAKE_INSTALL_PREFIX} MATCHES "^/home/" ) )
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/terminus_autorun.desktop DESTINATION /etc/xdg/autostart/ )
else()
set ( CONFIG_HOME $ENV{XDG_CONFIG_HOME})
if ( NOT (CONFIG_HOME))
set ( CONFIG_HOME $ENV{HOME}/.config )
endif()
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/terminus_autorun.desktop DESTINATION ${CONFIG_HOME}/autostart )
MESSAGE(STATUS "Autostart file data/terminus_autorun.desktop will not be installed. You must create your own .desktop file and put it at ~/.config/autostart")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/com.rastersoft.terminus.service.base ${CMAKE_CURRENT_BINARY_DIR}/com.rastersoft.terminus.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/com.rastersoft.terminus.service DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services/)
......
terminus (0.8.0-Debian1) sid; urgency=low
* Fixed some startup bugs
-- Sergio Costas Rodriguez <raster@rastersoft.com> Tue, 01 Aug 2017 23:55:00 +0200
terminus (0.7.0-Debian1) sid; urgency=low
* Added full palette support
* Added all palette styles from gnome-terminal
* Added Solarized palette
* Allows to set the preferred shell
* Allows to configure more details (cursor shape, using bolds, rewrap on resize, and terminal bell)
-- Sergio Costas Rodriguez <raster@rastersoft.com> Sat, 24 Dec 2016 23:55:00 +0200
......
......@@ -6,7 +6,7 @@ Build-Depends: build-essential, po-debconf, valac, libc6-dev, libatk1.0-dev, lib
Package: terminus
Architecture: any
Version: 0.7.0
Version: 0.8.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.8.0-Debian1) sid; urgency=low
* Fixed some startup bugs
-- Sergio Costas Rodriguez <raster@rastersoft.com> Tue, 01 Aug 2017 23:55:00 +0200
terminus (0.7.0-Debian1) sid; urgency=low
* Added full palette support
* Added all palette styles from gnome-terminal
* Added Solarized palette
* Allows to set the preferred shell
* Allows to configure more details (cursor shape, using bolds, rewrap on resize, and terminal bell)
-- Sergio Costas Rodriguez <raster@rastersoft.com> Sat, 24 Dec 2016 23:55:00 +0200
......
......@@ -6,7 +6,7 @@ Build-Depends: build-essential, po-debconf, valac, libc6-dev, libatk1.0-dev, lib
Package: terminus
Architecture: any
Version: 0.7.0
Version: 0.8.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.7.0
Version: 0.8.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.7.0")
set (VERSION "0.8.0")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)
configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.base ${CMAKE_BINARY_DIR}/src/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "0.7.0")
set (VERSION "0.8.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.7.0
//project version = 0.8.0
namespace Terminus {
......@@ -29,7 +29,7 @@ namespace Terminus {
Terminus.Bindkey bindkey;
class Terminuspalette : Object {
public bool custom;
public string? name;
public HashMap<string, string> name_locale;
......@@ -41,8 +41,7 @@ namespace Terminus {
public Gdk.RGBA? cursor_bg;
public Gdk.RGBA? highlight_fg;
public Gdk.RGBA? highlight_bg;*/
public Terminuspalette() {
this.name = null;
this.palette = {};
......@@ -56,7 +55,7 @@ namespace Terminus {
this.highlight_bg = null;*/
this.custom = false;
}
public bool compare_scheme() {
if (this.custom) {
......@@ -89,7 +88,7 @@ namespace Terminus {
return false;
}
}
key = Terminus.settings.get_string("cursor-fg-color");
if (((key == "") && (this.cursor_fg != null)) || ((key != "") && (this.cursor_fg == null))) {
return false;
......@@ -110,7 +109,7 @@ namespace Terminus {
return false;
}
}
key = Terminus.settings.get_string("highlight-fg-color");
if (((key == "") && (this.highlight_fg != null)) || ((key != "") && (this.highlight_fg == null))) {
return false;
......@@ -131,12 +130,12 @@ namespace Terminus {
return false;
}
}*/
return true;
}
public bool compare_palette() {
string[] current = Terminus.settings.get_strv("color-palete");
if (current.length != this.palette.length) {
return false;
......@@ -149,7 +148,7 @@ namespace Terminus {
}
return true;
}
public bool readpalette(string filename) {
if (!filename.has_suffix(".color_scheme")) {
......@@ -322,8 +321,11 @@ namespace Terminus {
private Terminus.Base? guake_terminal;
private Terminus.Window? guake_window;
private bool tmp_launch_terminal;
private bool tmp_launch_guake;
public Gee.List<Terminuspalette> palettes;
public Terminus.Properties window_properties;
public TerminusRoot(string[] argv) {
......@@ -338,9 +340,9 @@ namespace Terminus {
this.check_params(argv);
bool launch_terminal = true;
bool launch_guake;
this.tmp_launch_terminal = true;
this.tmp_launch_guake = false;
this.palettes = new Gee.ArrayList<Terminuspalette>();
this.read_color_schemes(GLib.Path.build_filename(Constants.DATADIR,"terminus"));
......@@ -354,40 +356,39 @@ namespace Terminus {
this.window_properties = new Terminus.Properties();
if (binded_key) {
launch_guake = Terminus.settings.get_boolean("enable-guake-mode");;
this.tmp_launch_guake = Terminus.settings.get_boolean("enable-guake-mode");;
} else {
launch_guake = false;
this.tmp_launch_guake = false;
}
if (this.launch_guake) {
launch_terminal = false;
this.tmp_launch_terminal = false;
this.check_guake = false;
launch_guake = true;
}
if (this.check_guake) {
launch_terminal = false;
launch_guake = Terminus.settings.get_boolean("enable-guake-mode");
this.tmp_launch_terminal = false;
this.tmp_launch_guake = Terminus.settings.get_boolean("enable-guake-mode");
}
if (launch_terminal) {
this.create_window(false);
}
if (launch_guake) {
this.create_window(true);
}
if (this.tmp_launch_terminal || this.tmp_launch_guake) {
Bus.own_name (BusType.SESSION, "com.rastersoft.terminus", BusNameOwnerFlags.NONE, this.on_bus_aquired, () => {
if (this.tmp_launch_guake) {
this.create_window(true);
}
this.tmp_launch_guake = false;
Terminus.keybind_settings.changed.connect(this.keybind_settings_changed);
Terminus.keybind_settings.changed.connect(this.keybind_settings_changed);
if (launch_terminal || launch_guake) {
Bus.own_name (BusType.SESSION, "com.rastersoft.terminus", BusNameOwnerFlags.NONE, this.on_bus_aquired, () => {}, () => {});
}, () => {});
print("Entro en Gmain\n");
Gtk.main();
}
}
public int ComparePalettes(Terminuspalette a, Terminuspalette b) {
if (a.name < b.name) {
return -1;
} else {
......@@ -398,9 +399,9 @@ namespace Terminus {
}
}
}
void read_color_schemes(string foldername) {
try {
var directory = File.new_for_path (foldername);
......@@ -423,6 +424,10 @@ namespace Terminus {
} catch (IOError e) {
GLib.stderr.printf ("Could not register service\n");
}
if (this.tmp_launch_terminal) {
this.create_window(false);
}
this.tmp_launch_terminal = false;
}
public void keybind_settings_changed(string key) {
......@@ -471,6 +476,7 @@ namespace Terminus {
public void check_params(string[] argv) {
int param_counter = 0;
bool exit_at_end = false;
while(param_counter < argv.length) {
param_counter++;
......@@ -482,6 +488,13 @@ namespace Terminus {
this.check_guake = true;
continue;
}
if ((argv[param_counter] == "-h") || (argv[param_counter] == "--help")) {
print("Usage: terminus [--guake] [--check_guake]\n");
exit_at_end = true;
}
}
if (exit_at_end) {
Posix.exit(0);
}
}
......@@ -522,7 +535,7 @@ namespace Terminus {
if (check_wayland() == 1) {
return false; // under Wayland we can't use bindkeys
}
while(param_counter < argv.length) {
param_counter++;
if (argv[param_counter] == "--nobindkey") {
......@@ -531,13 +544,13 @@ namespace Terminus {
}
return true;
}
/**
* Ensures that the palette stored in the settings is valid
* If not, replaces the ofending elements
*/
bool check_palette() {
string[] palette_string = Terminus.settings.get_strv("color-palete");
if (palette_string.length != 16) {
string[] tmp = {};
......@@ -555,7 +568,7 @@ namespace Terminus {
}
return false;
}
[DBus (name = "com.rastersoft.terminus")]
public class RemoteControl : GLib.Object {
......
......@@ -13,7 +13,7 @@ custom: terminus_gnome_shell/metadata.json share/gnome-shell/extensions/showTerm
*vapidir: src/vapidir
vala_binary: src/terminus
*version: 0.7.0
*version: 0.8.0
use_gresource: extras_gresource_xml
vala_vapi: checkwayland.vapi
*vala_package: posix
......
......@@ -22,13 +22,13 @@ const GioSSS = Gio.SettingsSchemaSource;
const TerminusClass = new Lang.Class({
Name: 'Terminus.Launcher',
_init: function() {
this._settings = new Gio.Settings({schema: 'org.rastersoft.terminus.keybindings'});
this._settingsChanged(null,"guake-mode"); // copy the guake-mode key to guake-mode-gnome-shell key
this._settingsChangedConnect = this._settings.connect('changed',Lang.bind(this,this._settingsChanged));
let mode = Shell.ActionMode ? Shell.ActionMode.NORMAL : Shell.KeyBindingMode.ALL;
let flags = Meta.KeyBindingFlags.NONE;
this.instance = null;
......@@ -38,13 +38,12 @@ const TerminusClass = new Lang.Class({
mode,
Lang.bind(this, this.launch_function)
);
},
destroy: function() {
Main.wm.removeKeybinding("guake-mode");
},
launch_function: function() {
if (this.instance === null) {
this.instance = new MyProxy(Gio.DBus.session, 'com.rastersoft.terminus','/com/rastersoft/terminus');
......@@ -52,7 +51,7 @@ const TerminusClass = new Lang.Class({
}
this.instance.SwapGuakeSync();
},
_settingsChanged: function(st,name) {
if (name == "guake-mode") {
var new_key = this._settings.get_string("guake-mode");
......@@ -60,8 +59,8 @@ const TerminusClass = new Lang.Class({
}
}
});
function init() {
}
......@@ -73,5 +72,5 @@ function enable() {
}
function disable() {
}
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