Quake mode
This commit is contained in:
parent
29c2d3e44d
commit
a075a6cc62
14
terminator
14
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("<Ctrl><Shift>a",cbkeyCloak,term)
|
||||
|
||||
gtk.main ()
|
||||
|
||||
|
||||
|
|
|
@ -120,6 +120,7 @@ class TerminatorConfValuestore:
|
|||
'extreme_tabs' : False,
|
||||
'fullscreen' : False,
|
||||
'borderless' : False,
|
||||
'hidden' : False,
|
||||
'maximise' : False,
|
||||
'handle_size' : -1,
|
||||
'focus_on_close' : 'auto',
|
||||
|
|
|
@ -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 ()
|
||||
|
|
Loading…
Reference in New Issue