From a075a6cc62a1df94249e46910455f1721fae4a28 Mon Sep 17 00:00:00 2001 From: Chris James Date: Mon, 28 Jul 2008 02:10:30 -0500 Subject: [PATCH 1/4] Quake mode --- terminator | 14 ++++++++++++-- terminatorlib/config.py | 1 + terminatorlib/terminator.py | 29 ++++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/terminator b/terminator index 01fa5d94..e7737f94 100755 --- a/terminator +++ b/terminator @@ -21,6 +21,9 @@ import os, sys from optparse import OptionParser +# import keybinder for quake mode +import deskbar.core.keybinder as bindkey + from terminatorlib.version import APP_NAME, APP_VERSION try: @@ -48,6 +51,7 @@ except ImportError: from terminatorlib.terminator import Terminator + if __name__ == '__main__': def execute_cb (option, opt, value, parser): """Callback for use in parsing Terminator command line options""" @@ -87,6 +91,7 @@ if __name__ == '__main__': help="Set the window into fullscreen mode") parser.add_option ("-b", "--borderless", action="store_true", dest="borderless", help="Turn off the window's borders") + parser.add_option("-H", "--hidden", action="store_true", dest="hidden", help="Open the %s window hidden"%APP_NAME.capitalize()) parser.add_option ("-n", "--no-gconf", dest="no_gconf", action="store_true", help="ignore gnome-terminal gconf settings") parser.add_option ("-p", "--profile", dest="profile", action="callback", @@ -144,8 +149,13 @@ See the following bug report for more details: pass dbg ('profile_cb: settled on profile: "%s"' % options.profile) - term = Terminator (options.profile, command, options.fullscreen, options.maximise, - options.borderless, options.no_gconf) + term = Terminator (options.profile, command, options.fullscreen, options.maximise, options.borderless, options.no_gconf, options.hidden) + + # binding for quake mode + def cbkeyCloak(term): + term.cbkeyCloak() + bindkey.tomboy_keybinder_bind("a",cbkeyCloak,term) gtk.main () + diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 0f955d0f..9f63c1c1 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -120,6 +120,7 @@ class TerminatorConfValuestore: 'extreme_tabs' : False, 'fullscreen' : False, 'borderless' : False, + 'hidden' : False, 'maximise' : False, 'handle_size' : -1, 'focus_on_close' : 'auto', diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 90ab68be..4c311006 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -87,7 +87,7 @@ class TerminatorNotebookTabLabel(gtk.HBox): return self.size_request()[0] class Terminator: - def __init__ (self, profile = None, command = None, fullscreen = False, maximise = False, borderless = False, no_gconf=False): + def __init__ (self, profile = None, command = None, fullscreen = False, maximise = False, borderless = False, no_gconf=False, hidden=False): self.profile = profile self.command = command @@ -95,6 +95,8 @@ class Terminator: self._maximised = False self._fullscreen = False self._f11_modifier = False + self.hidden = False + self.term_list = [] stores = [] stores.append (config.TerminatorConfValuestoreRC ()) @@ -167,6 +169,9 @@ class Terminator: if borderless or self.conf.borderless: self.window.set_decorated (False) + if hidden or self.conf.hidden: + self.hide() + # Set RGBA colormap if possible so VTE can use real alpha # channels for transparency. if self.conf.enable_real_transparency: @@ -185,6 +190,28 @@ class Terminator: self.window.show () term.spawn_child () + # jgc: show/hide functions for quake mode + def show(self): + """Show the terminator window""" + # restore window position + self.window.move(self.pos[0],self.pos[1]) + self.window.present() + self.hidden = False + + def hide(self): + """Hide the terminator window""" + # save window position + self.pos = self.window.get_position() + self.window.hide() + self.hidden = True + + def cbkeyCloak(self): + """Callback event for show/hide keypress""" + if self.hidden: + self.show() + else: + self.hide() + def maximize (self): """ Maximize the Terminator window.""" self.window.maximize () From 436c7be7588d18422dc2e80f212145c7f84f6da9 Mon Sep 17 00:00:00 2001 From: Chris James Date: Mon, 28 Jul 2008 02:35:22 -0500 Subject: [PATCH 2/4] Changed shortcut to a --- terminator | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/terminator b/terminator index e7737f94..c283c0b5 100755 --- a/terminator +++ b/terminator @@ -21,9 +21,6 @@ import os, sys from optparse import OptionParser -# import keybinder for quake mode -import deskbar.core.keybinder as bindkey - from terminatorlib.version import APP_NAME, APP_VERSION try: @@ -51,6 +48,8 @@ except ImportError: from terminatorlib.terminator import Terminator +# import keybinder for quake mode +import deskbar.core.keybinder as bindkey if __name__ == '__main__': def execute_cb (option, opt, value, parser): @@ -154,7 +153,7 @@ See the following bug report for more details: # binding for quake mode def cbkeyCloak(term): term.cbkeyCloak() - bindkey.tomboy_keybinder_bind("a",cbkeyCloak,term) + bindkey.tomboy_keybinder_bind("a",cbkeyCloak,term) gtk.main () From 58747628a51311a5ae528c17aede6d11f73a24be Mon Sep 17 00:00:00 2001 From: Chris James Date: Mon, 28 Jul 2008 03:54:30 -0500 Subject: [PATCH 3/4] fixed hide --- terminatorlib/terminator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 4c311006..8440811c 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -95,8 +95,7 @@ class Terminator: self._maximised = False self._fullscreen = False self._f11_modifier = False - self.hidden = False - + self.term_list = [] stores = [] stores.append (config.TerminatorConfValuestoreRC ()) @@ -169,8 +168,6 @@ class Terminator: if borderless or self.conf.borderless: self.window.set_decorated (False) - if hidden or self.conf.hidden: - self.hide() # Set RGBA colormap if possible so VTE can use real alpha # channels for transparency. @@ -190,6 +187,9 @@ class Terminator: self.window.show () term.spawn_child () + if hidden or self.conf.hidden: + self.hide() + # jgc: show/hide functions for quake mode def show(self): """Show the terminator window""" From 66c1de7a435f88c63750d4dd42a5c328639207c2 Mon Sep 17 00:00:00 2001 From: Chris James Date: Fri, 1 Aug 2008 19:22:28 -0500 Subject: [PATCH 4/4] define _hidden on start --- terminatorlib/terminator.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 8440811c..470936c0 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -95,6 +95,7 @@ class Terminator: self._maximised = False self._fullscreen = False self._f11_modifier = False + self._hidden = False self.term_list = [] stores = [] @@ -195,19 +196,20 @@ class Terminator: """Show the terminator window""" # restore window position self.window.move(self.pos[0],self.pos[1]) - self.window.present() - self.hidden = False + #self.window.present() + self.window.show_now() + self._hidden = False def hide(self): """Hide the terminator window""" # save window position self.pos = self.window.get_position() self.window.hide() - self.hidden = True + self._hidden = True def cbkeyCloak(self): """Callback event for show/hide keypress""" - if self.hidden: + if self._hidden: self.show() else: self.hide()