terminatorlib package

Submodules

terminatorlib.borg module

borg.py - We are the borg. Resistance is futile.

http://code.activestate.com/recipes/66531/ ActiveState’s policy appears to be that snippets exist to encourage re-use, but I can not find any specific licencing terms.

class terminatorlib.borg.Borg(borgtype=None)[source]

Definition of a class that can never be duplicated. Correct usage is thus:

>>> from borg import Borg
>>> class foo(Borg):
...     # All attributes on a borg class *must* = None
...     attribute = None
...     def __init__(self):
...         Borg.__init__(self, self.__class__.__name__)
...     def prepare_attributes(self):
...         if not self.attribute:
...             self.attribute = []
...
>>> bar = foo()
>>> bar.prepare_attributes()

The important thing to note is that all attributes of borg classes must be declared as being None. If you attempt to use static class attributes you will get unpredicted behaviour. Instead, prepare_attributes() must be called which will then see the attributes in the shared state, and initialise them if necessary.

__init__(borgtype=None)[source]

Class initialiser. Overwrite our class dictionary with the shared state. This makes us identical to every other instance of this class type.

prepare_attributes()[source]

This should be used to prepare any attributes of the borg class.

_Borg__shared_state = {}

terminatorlib.config module

Terminator by Chris Jones <cmsj@tenshu.net>

Classes relating to configuration

>>> DEFAULTS['global_config']['focus']
'click'
>>> config = Config()
>>> config['focus'] = 'sloppy'
>>> config['focus']
'sloppy'
>>> DEFAULTS['global_config']['focus']
'click'
>>> config2 = Config()
>>> config2['focus']
'sloppy'
>>> config2['focus'] = 'click'
>>> config2['focus']
'click'
>>> config['focus']
'click'
>>> config['geometry_hinting'].__class__.__name__
'bool'
>>> plugintest = {}
>>> plugintest['foo'] = 'bar'
>>> config.plugin_set_config('testplugin', plugintest)
>>> config.plugin_get_config('testplugin')
{'foo': 'bar'}
>>> config.plugin_get('testplugin', 'foo')
'bar'
>>> config.plugin_get('testplugin', 'foo', 'new')
'bar'
>>> config.plugin_get('testplugin', 'algo')
Traceback (most recent call last):
...
KeyError: 'ConfigBase::get_item: unknown key algo'
>>> config.plugin_get('testplugin', 'algo', 1)
1
>>> config.plugin_get('anothertestplugin', 'algo', 500)
500
>>> config.get_profile()
'default'
>>> config.set_profile('my_first_new_testing_profile')
>>> config.get_profile()
'my_first_new_testing_profile'
>>> config.del_profile('my_first_new_testing_profile')
>>> config.get_profile()
'default'
>>> config.list_profiles().__class__.__name__
'list'
>>> config.options_set({})
>>> config.options_get()
{}
>>> 
class terminatorlib.config.Config(profile='default')[source]

Bases: object

Class to provide a slightly richer config API above ConfigBase

__getitem__(key, default=None)[source]

Look up a configuration item

__init__(profile='default')[source]
__setitem__(key, value)[source]

Set a particular configuration item

add_layout(name, layout)[source]

Add a new layout

add_profile(profile)[source]

Add a new profile

del_layout(layout)[source]

Delete a layout

del_profile(profile)[source]

Delete a profile

get_profile()[source]

Get our profile

get_system_focus()[source]

Look up the system focus setting

get_system_mono_font()[source]

Look up the system font

get_system_prop_font()[source]

Look up the system font

inhibit_save()[source]

Prevent calls to save() being honoured

layout_get_config(layout)[source]

Return a layout

layout_set_config(layout, tree)[source]

Set a layout

list_layouts()[source]

List all configured layouts

list_profiles()[source]

List all configured profiles

on_gconf_notify(_client, _cnxn_id, _entry, _what)[source]

Handle a gconf watch changing

options_get()[source]

Get the command line options

options_set(options)[source]

Set the command line options

plugin_del_config(plugin)[source]

Delete a whole config tree for a given plugin

plugin_get(pluginname, key, default=None)[source]

Get a plugin config value, if doesn’t exist return default if specified

plugin_get_config(plugin)[source]

Return a whole config tree for a given plugin

plugin_set(pluginname, key, value)[source]

Set a plugin config value

plugin_set_config(plugin, tree)[source]

Set a whole config tree for a given plugin

rename_layout(layout, newname)[source]

Rename a layout

rename_profile(profile, newname)[source]

Rename a profile

replace_layout(name, layout)[source]

Replace an existing layout

save()[source]

Cause ConfigBase to save our config to file

set_profile(profile, force=False)[source]

Set our profile (which usually means change it)

uninhibit_save()[source]

Allow calls to save() to be honoured

base = None
gconf = None
inhibited = None
profile = None
system_focus = None
system_mono_font = None
system_prop_font = None
class terminatorlib.config.ConfigBase[source]

Bases: terminatorlib.borg.Borg

Class to provide access to our user configuration

__init__()[source]

Class initialiser

add_layout(name, layout)[source]

Add a new layout

add_profile(profile)[source]

Add a new profile

defaults_to_configspec()[source]

Convert our tree of default values into a ConfigObj validation specification

del_plugin(plugin)[source]

Delete a whole tree for a plugin

get_item(key, profile='default', plugin=None, default=None)[source]

Look up a configuration item

get_layout(layout)[source]

Return a layout

get_plugin(plugin)[source]

Return a whole tree for a plugin

load()[source]

Load configuration data from our various sources

prepare_attributes()[source]

Set up our borg environment

reload()[source]

Force a reload of the base config

replace_layout(name, layout)[source]

Replaces a layout with the given name

save()[source]

Save the config to a file

set_item(key, value, profile='default', plugin=None)[source]

Set a configuration item

set_layout(layout, tree)[source]

Set a layout

set_plugin(plugin, tree)[source]

Set a whole tree for a plugin

command_line_options = None
global_config = None
keybindings = None
layouts = None
loaded = None
plugins = None
profiles = None
sections = None
whined = None

terminatorlib.container module

container.py - classes necessary to contain Terminal widgets

class terminatorlib.container.Container[source]

Bases: object

Base class for Terminator Containers

__init__()[source]

Class initialiser

add(widget, metadata=None)[source]

Add a widget to the container

closeterm(widget)[source]

Handle the closure of a terminal

connect_child(widget, signal, handler, *args)[source]

Register the requested signal and record its connection ID

construct_confirm_close(window, reqtype)[source]

Create a confirmation dialog for closing things

create_layout(layout)[source]

Apply settings for our layout

describe_layout(count, parent, global_layout, child_order)[source]

Describe our current layout

disconnect_child(widget)[source]

De-register the signals for a child

get_child_metadata(widget)[source]

Return metadata that would be useful to recreate ourselves after our child is .remove()d and .add()ed

get_children()[source]

Return an ordered list of the children of this Container

get_offspring()[source]

Return a list of direct child widgets, if any

get_visible_terminals()[source]

Walk the widget tree to find all of the visible terminals. That is, any terminals which are not hidden in another Notebook pane

hoover()[source]

Ensure we still have a reason to exist

propagate_title_change(widget, title)[source]

Pass a title change up the widget stack

register_signals(widget)[source]

Register gobject signals in a way that avoids multiple inheritance

remove(widget)[source]

Remove a widget from the container

replace(oldwidget, newwidget)[source]

Replace the child oldwidget with newwidget. This is the bare minimum required for this operation. Containers should override it if they have more complex requirements

resizeterm(widget, keyname)[source]

Handle a keyboard event requesting a terminal resize

rotate(widget, clockwise)[source]

Rotate children in this container

split_axis(widget, vertical=True, cwd=None, sibling=None, siblinglast=None)[source]

Default axis splitter. This should be implemented by subclasses

split_horiz(widget, cwd=None)[source]

Split this container horizontally

split_vert(widget, cwd=None)[source]

Split this container vertically

toggle_zoom(widget, fontscale=False)[source]

Toggle the existing zoom state

unzoom(widget)[source]

Unzoom a terminal

zoom(widget, fontscale=False)[source]

Zoom a terminal

children = None
config = None
immutable = None
signalman = None
signals = None
terminator = None

terminatorlib.cwd module

cwd.py - function necessary to get the cwd for a given pid on various OSes

>>> cwd = get_default_cwd()
>>> cwd.__class__.__name__
'str'
>>> func = get_pid_cwd()
>>> func.__class__.__name__
'function'
terminatorlib.cwd.get_default_cwd()[source]

Determine a reasonable default cwd

terminatorlib.cwd.get_pid_cwd()[source]

Determine an appropriate cwd function for the OS we are running on

terminatorlib.cwd.linux_get_pid_cwd(pid)[source]

Determine the cwd for a given PID on Linux kernels

terminatorlib.cwd.proc_get_pid_cwd(pid, path)[source]

Extract the cwd of a PID from proc, given the PID and the /proc path to insert it into, e.g. /proc/%s/cwd

terminatorlib.cwd.psutil_cwd(pid)[source]

Determine the cwd using psutil which also supports Darwin

terminatorlib.cwd.sunos_get_pid_cwd(pid)[source]

Determine the cwd for a given PID on SunOS kernels

terminatorlib.debugserver module

class terminatorlib.debugserver.PythonConsoleServer(request, client_address, server)[source]

Bases: SocketServer.BaseRequestHandler

finish()[source]
handle()[source]
setup()[source]
verify_request(request, client_address)[source]
env = None
class terminatorlib.debugserver.TerminatorConsole(locals=None, filename='<console>')[source]

Bases: code.InteractiveConsole

parse_telnet(data)[source]
raw_input(prompt=None)[source]
run(server)[source]
write(data)[source]
terminatorlib.debugserver.ddbg(msg)[source]
terminatorlib.debugserver.spawn(env)[source]

terminatorlib.editablelabel module

Editable Label class

class terminatorlib.editablelabel.EditableLabel(text='')[source]

Bases: gtk.EventBox

An eventbox that partialy emulate a gtk.Label On double-click, the label is editable, entering an empty will revert back to automatic text

__init__(text='')[source]

Class initialiser

_entry_to_label(widget, event)[source]

replace gtk.Entry by the gtk.Label

_on_click_text(widget, event)[source]

event handling text edition

_on_entry_activated(widget)[source]

get the text entered in gtk.Entry

_on_entry_buttonpress(widget, event)[source]

handle button events in gtk.Entry.

_on_entry_keypress(widget, event)[source]

handle keypressed in gtk.Entry

editing()[source]

Return if we are currently editing

get_text()[source]

get the text from the label

is_custom()[source]

Return whether or not we have a custom string set

modify_fg(state, color)[source]

Set the label foreground

modify_font(fontdesc)[source]

Set the label font using a pango.FontDescription

set_angle(angle)[source]

set angle of the label

set_custom()[source]

Set the customness of the string to True

set_text(text, force=False)[source]

set the text of the label

_autotext = None
_custom = None
_ebox = None
_entry = None
_entry_handler_id = None
_label = None

terminatorlib.encoding module

TerminatorEncoding by Emmanuel Bretelle <chantra@debuntu.org>

TerminatorEncoding supplies a list of possible encoding
values.
This list is taken from gnome-terminal’s src/terminal-encoding.c
and src/encoding.c
class terminatorlib.encoding.TerminatorEncoding[source]

Class to store encoding details

__init__()[source]
static get_list()[source]

Return a list of supported encodings

encodings = [[True, None, 'Current Locale'], [False, 'ISO-8859-1', 'Western'], [False, 'ISO-8859-2', 'Central European'], [False, 'ISO-8859-3', 'South European'], [False, 'ISO-8859-4', 'Baltic'], [False, 'ISO-8859-5', 'Cyrillic'], [False, 'ISO-8859-6', 'Arabic'], [False, 'ISO-8859-7', 'Greek'], [False, 'ISO-8859-8', 'Hebrew Visual'], [False, 'ISO-8859-8-I', 'Hebrew'], [False, 'ISO-8859-9', 'Turkish'], [False, 'ISO-8859-10', 'Nordic'], [False, 'ISO-8859-13', 'Baltic'], [False, 'ISO-8859-14', 'Celtic'], [False, 'ISO-8859-15', 'Western'], [False, 'ISO-8859-16', 'Romanian'], [False, 'UTF-8', 'Unicode'], [False, 'ARMSCII-8', 'Armenian'], [False, 'BIG5', 'Chinese Traditional'], [False, 'BIG5-HKSCS', 'Chinese Traditional'], [False, 'CP866', 'Cyrillic/Russian'], [False, 'EUC-JP', 'Japanese'], [False, 'EUC-KR', 'Korean'], [False, 'EUC-TW', 'Chinese Traditional'], [False, 'GB18030', 'Chinese Simplified'], [False, 'GB2312', 'Chinese Simplified'], [False, 'GBK', 'Chinese Simplified'], [False, 'GEORGIAN-PS', 'Georgian'], [False, 'HZ', 'Chinese Simplified'], [False, 'IBM850', 'Western'], [False, 'IBM852', 'Central European'], [False, 'IBM855', 'Cyrillic'], [False, 'IBM857', 'Turkish'], [False, 'IBM862', 'Hebrew'], [False, 'IBM864', 'Arabic'], [False, 'ISO-2022-JP', 'Japanese'], [False, 'ISO-2022-KR', 'Korean'], [False, 'ISO-IR-111', 'Cyrillic'], [False, 'KOI8-R', 'Cyrillic'], [False, 'KOI8-U', 'Cyrillic/Ukrainian'], [False, 'MAC_ARABIC', 'Arabic'], [False, 'MAC_CE', 'Central European'], [False, 'MAC_CROATIAN', 'Croatian'], [False, 'MAC-CYRILLIC', 'Cyrillic'], [False, 'MAC_DEVANAGARI', 'Hindi'], [False, 'MAC_FARSI', 'Persian'], [False, 'MAC_GREEK', 'Greek'], [False, 'MAC_GUJARATI', 'Gujarati'], [False, 'MAC_GURMUKHI', 'Gurmukhi'], [False, 'MAC_HEBREW', 'Hebrew'], [False, 'MAC_ICELANDIC', 'Icelandic'], [False, 'MAC_ROMAN', 'Western'], [False, 'MAC_ROMANIAN', 'Romanian'], [False, 'MAC_TURKISH', 'Turkish'], [False, 'MAC_UKRAINIAN', 'Cyrillic/Ukrainian'], [False, 'SHIFT-JIS', 'Japanese'], [False, 'TCVN', 'Vietnamese'], [False, 'TIS-620', 'Thai'], [False, 'UHC', 'Korean'], [False, 'VISCII', 'Vietnamese'], [False, 'WINDOWS-1250', 'Central European'], [False, 'WINDOWS-1251', 'Cyrillic'], [False, 'WINDOWS-1252', 'Western'], [False, 'WINDOWS-1253', 'Greek'], [False, 'WINDOWS-1254', 'Turkish'], [False, 'WINDOWS-1255', 'Hebrew'], [False, 'WINDOWS-1256', 'Arabic'], [False, 'WINDOWS-1257', 'Baltic'], [False, 'WINDOWS-1258', 'Vietnamese']]

terminatorlib.factory module

factory.py - Maker of objects

>>> maker = Factory()
>>> window = maker.make_window()
>>> maker.isinstance(window, 'Window')
True
>>> terminal = maker.make_terminal()
>>> maker.isinstance(terminal, 'Terminal')
True
>>> hpaned = maker.make_hpaned()
>>> maker.isinstance(hpaned, 'HPaned')
True
>>> vpaned = maker.make_vpaned()
>>> maker.isinstance(vpaned, 'VPaned')
True
class terminatorlib.factory.Factory[source]

Bases: terminatorlib.borg.Borg

Definition of a class that makes other classes

__init__()[source]

Class initialiser

isinstance(product, classtype)[source]

Check if a given product is a particular type of object

make(product, **kwargs)[source]

Make the requested product

make_hpaned(**kwargs)[source]

Make an HPaned

make_notebook(**kwargs)[source]

Make a Notebook

make_terminal(**kwargs)[source]

Make a Terminal

make_vpaned(**kwargs)[source]

Make a VPaned

make_window(**kwargs)[source]

Make a Window

prepare_attributes()[source]

Required by the borg, but a no-op here

type(product)[source]

Determine the type of an object we’ve previously created

instance_types = {}
instance_types_keys = []
types = {'Container': 'container', 'VPaned': 'paned', 'Terminal': 'terminal', 'Window': 'window', 'Notebook': 'notebook', 'Paned': 'paned', 'HPaned': 'paned'}
types_keys = ['Container', 'VPaned', 'Terminal', 'Window', 'Notebook', 'Paned', 'HPaned']

terminatorlib.freebsd module

freebsd.get_process_cwd(pid):
Use sysctl() to retrieve the cwd of an arbitrary process on FreeBSD using kern.proc.filedesc, as used by procstat(1). Tested on FreeBSD 7-STABLE/amd64 from April 11 2008.
class terminatorlib.freebsd.kinfo_file[source]

Bases: _ctypes.Structure

struct kinfo_file, defined in /usr/include/sys/user.h

_fields_ = [('kf_structsize', <class 'ctypes.c_long'>), ('kf_type', <class 'ctypes.c_long'>), ('kf_fd', <class 'ctypes.c_long'>), ('kf_ref_count', <class 'ctypes.c_long'>), ('kf_flags', <class 'ctypes.c_long'>), ('kf_offset', <class 'ctypes.c_ulong'>), ('kf_vnode_type', <class 'ctypes.c_long'>), ('kf_sock_domain', <class 'ctypes.c_long'>), ('kf_sock_type', <class 'ctypes.c_long'>), ('kf_sock_protocol', <class 'ctypes.c_long'>), ('kf_path', <class 'terminatorlib.freebsd.c_char_Array_1024'>), ('kf_sa_local', <class 'terminatorlib.freebsd.sockaddr_storage'>), ('kf_sa_peer', <class 'terminatorlib.freebsd.sockaddr_storage'>)]
kf_fd

Structure/Union member

kf_flags

Structure/Union member

kf_offset

Structure/Union member

kf_path

Structure/Union member

kf_ref_count

Structure/Union member

kf_sa_local

Structure/Union member

kf_sa_peer

Structure/Union member

kf_sock_domain

Structure/Union member

kf_sock_protocol

Structure/Union member

kf_sock_type

Structure/Union member

kf_structsize

Structure/Union member

kf_type

Structure/Union member

kf_vnode_type

Structure/Union member

class terminatorlib.freebsd.sockaddr_storage[source]

Bases: _ctypes.Structure

struct sockaddr_storage, defined in /usr/include/sys/socket.h

__ss_align

Structure/Union member

__ss_pad1

Structure/Union member

__ss_pad2

Structure/Union member

_fields_ = [('ss_len', <class 'ctypes.c_char'>), ('ss_family', <class 'ctypes.c_char'>), ('__ss_pad1', <class 'terminatorlib.freebsd.c_char_Array_6'>), ('__ss_align', <class 'ctypes.c_longlong'>), ('__ss_pad2', <class 'terminatorlib.freebsd.c_char_Array_112'>)]
ss_family

Structure/Union member

ss_len

Structure/Union member

terminatorlib.freebsd.get_process_cwd(pid)[source]

Return string containing the current working directory of the given pid, or None on failure.

terminatorlib.ipc module

ipc.py - DBus server and API calls

class terminatorlib.ipc.DBusService[source]

Bases: terminatorlib.borg.Borg, dbus.service.Object

DBus Server class. This is implemented as a Borg

__init__()[source]

Class initialiser

get_terminal_tab(uuid)[source]

Return the UUID of the parent tab of a given terminal

get_terminal_tab_title(uuid)[source]

Return the title of a parent tab of a given terminal

get_terminals(uuid)[source]

Return a list of all the terminals

new_tab(options=dbus.Dictionary({}, signature=None))[source]

Create a new tab

new_window(options=dbus.Dictionary({}, signature=None))[source]

Create a new Window

prepare_attributes()[source]

Ensure we are populated

terminal_hsplit(uuid=None)[source]

Split a terminal horizontally, by UUID

terminal_split(uuid, horiz)[source]

Split a terminal horizontally or vertically, by UUID

terminal_vsplit(uuid=None)[source]

Split a terminal vertically, by UUID

_dbus_class_table = {'dbus.service.Interface': {}, 'dbus.service.FallbackObject': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Introspect at 0x43533534>}}, 'dbus.service.Object': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Introspect at 0x43533534>}}, 'terminatorlib.ipc.DBusService': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Introspect at 0x43533534>}, 'net.tenshu.Terminator_0x3bcad31e': {'get_terminal_tab': <function get_terminal_tab at 0x436f1144>, 'terminal_hsplit': <function terminal_hsplit at 0x436f1064>, 'terminal_vsplit': <function terminal_vsplit at 0x436f109c>, 'new_window': <function new_window at 0x43519fb4>, 'get_terminals': <function get_terminals at 0x436f110c>, 'new_tab': <function new_tab at 0x436f102c>, 'get_terminal_tab_title': <function get_terminal_tab_title at 0x436f117c>}}}
bus_name = None
bus_path = None
terminator = None
terminatorlib.ipc.get_terminal_tab(*args, **argd)[source]
terminatorlib.ipc.get_terminal_tab_title(*args, **argd)[source]
terminatorlib.ipc.get_terminals(*args, **argd)[source]
terminatorlib.ipc.new_tab(*args, **argd)[source]
terminatorlib.ipc.new_window(*args, **argd)[source]
terminatorlib.ipc.terminal_hsplit(*args, **argd)[source]
terminatorlib.ipc.terminal_vsplit(*args, **argd)[source]
terminatorlib.ipc.with_proxy(func)[source]

Decorator function to connect to the session dbus bus

terminatorlib.keybindings module

Terminator by Chris Jones <cmsj@tenshu.net>

Validator and functions for dealing with Terminator’s customisable keyboard shortcuts.

exception terminatorlib.keybindings.KeymapError[source]

Bases: exceptions.Exception

Custom exception for errors in keybinding configurations

class terminatorlib.keybindings.Keybindings[source]

Class to handle loading and lookup of Terminator keybindings

__init__()[source]
_lookup_modifier(modifier)[source]

Map modifier names to gtk values

_parsebinding(binding)[source]

Parse an individual binding using gtk’s binding function

configure(bindings)[source]

Accept new bindings and reconfigure with them

lookup(event)[source]

Translate a keyboard event into a mapped key

reload()[source]

Parse bindings and mangle into an appropriate form

_lookup = None
_masks = None
empty = {}
keys = None
modifiers = {'control': <flags GDK_CONTROL_MASK of type GdkModifierType>, 'ctrl': <flags GDK_CONTROL_MASK of type GdkModifierType>, 'shift': <flags GDK_SHIFT_MASK of type GdkModifierType>, 'primary': <flags GDK_CONTROL_MASK of type GdkModifierType>, 'alt': <flags GDK_MOD1_MASK of type GdkModifierType>, 'super': <flags GDK_SUPER_MASK of type GdkModifierType>}

terminatorlib.layoutlauncher module

layoutlauncher.py - class for the Layout Launcher window

class terminatorlib.layoutlauncher.LayoutLauncher[source]

Class implementing the various parts of the preferences editor

__init__()[source]
launch_layout()[source]

Launch the selected layout as new instance

on_destroy_event(widget, data=None)[source]

Handle window destruction

on_launchbutton_clicked(widget)[source]

Handle button click

on_row_activated(widget, path, view_column)[source]

Handle item double-click and return

update_layouts()[source]

Update the contents of the layout

builder = None
config = None
keybindings = None
layouttreestore = None
layouttreeview = None
plugins = None
registry = None
terminator = None
window = None

terminatorlib.notebook module

notebook.py - classes for the notebook widget

class terminatorlib.notebook.Notebook(window)[source]

Bases: terminatorlib.container.Container, gtk.Notebook

Class implementing a gtk.Notebook container

__init__(window)[source]

Class initialiser

add(widget, metadata=None)[source]

Add a widget to the container

clean_last_active_term()[source]

Clean up old entries in last_active_term

closetab(widget, label)[source]

Close a tab

configure()[source]

Apply widget-wide settings

create_layout(layout)[source]

Apply layout configuration

deferred_on_tab_switch(notebook, page, page_num, data=None)[source]

Prime a single idle tab switch signal, using the most recent set of params

do_deferred_on_tab_switch()[source]

Perform the latest tab switch signal, and resetting the pending flag

find_tab_root(widget)[source]

Look for the tab child which is or ultimately contains the supplied widget

get_child_metadata(widget)[source]

Fetch the relevant metadata for a widget which we’d need to recreate it when it’s readded

get_children()[source]

Return an ordered list of our children

hoover()[source]

Clean up any empty tabs and if we only have one tab left, die

newtab(debugtab=False, widget=None, cwd=None, metadata=None, profile=None)[source]

Add a new tab, optionally supplying a child widget

on_tab_switch(notebook, page, page_num, data=None)[source]

Do the real work for a tab switch

page_num_descendant(widget)[source]

Find the tabnum of the tab containing a widget at any level

remove(widget)[source]

Remove a widget from the container

replace(oldwidget, newwidget)[source]

Replace a tab’s contents with a new widget

resizeterm(widget, keyname)[source]

Handle a keyboard event requesting a terminal resize

set_last_active_term(uuid)[source]

Set the last active term for uuid

split_axis(widget, vertical=True, cwd=None, sibling=None, widgetfirst=True)[source]

Split the axis of a terminal inside us

unzoom(widget)[source]

Unzoom a terminal

update_tab_label_text(widget, text)[source]

Update the text of a tab label

wrapcloseterm(widget)[source]

A child terminal has closed

zoom(widget, fontscale=False)[source]

Zoom a terminal

last_active_term = None
pending_on_tab_switch = None
pending_on_tab_switch_args = None
window = None
class terminatorlib.notebook.TabLabel(title, notebook)[source]

Bases: gtk.HBox

Class implementing a label widget for Notebook tabs

__init__(title, notebook)[source]

Class initialiser

get_custom_label()[source]

Return a custom label if we have one, otherwise None

get_label()[source]
on_close(_widget)[source]

The close button has been clicked. Destroy the tab

set_custom_label(text)[source]

Set a permanent label as if the user had edited it

set_label(text)[source]

Update the text of our label

update_angle()[source]

Update the angle of a label

update_button()[source]

Update the state of our close button

button = None
config = None
icon = None
label = None
notebook = None
terminator = None

terminatorlib.optionparse module

Terminator.optionparse - Parse commandline options

terminatorlib.optionparse.execute_cb(option, opt, value, lparser)[source]

Callback for use in parsing execute options

terminatorlib.optionparse.parse_options()[source]

Parse the command line options

terminatorlib.paned module

paned.py - a base Paned container class and the vertical/horizontal variants

class terminatorlib.paned.HPaned[source]

Bases: terminatorlib.paned.Paned, gtk.HPaned

Merge gtk.HPaned into our base Paned Container

__init__()[source]

Class initialiser

get_length()[source]
set_pos(pos)[source]
class terminatorlib.paned.Paned[source]

Bases: terminatorlib.container.Container

Base class for Paned Containers

__init__()[source]

Class initialiser

_do_redistribute(recurse_up=False, recurse_down=False)[source]
add(widget, metadata=None)[source]

Add a widget to the container

create_layout(layout)[source]

Apply layout configuration

do_redistribute(recurse_up=False, recurse_down=False)[source]

Evenly divide available space between sibling panes

get_child_metadata(widget)[source]

Return metadata about a child

get_children()[source]

Return an ordered list of our children

grab_focus()[source]

We don’t want focus, we want a Terminal to have it

hoover()[source]

Check that we still have a reason to exist

new_size(widget, allocation)[source]
on_button_press(widget, event)[source]

Handle button presses on a Pane

remove(widget)[source]

Remove a widget from the container

resizeterm(widget, keyname)[source]

Handle a keyboard event requesting a terminal resize

rotate(widget, clockwise)[source]

Default rotation. This should be implemented by subclasses

set_position(pos)[source]
set_position_by_ratio()[source]
split_axis(widget, vertical=True, cwd=None, sibling=None, widgetfirst=True)[source]

Default axis splitter. This should be implemented by subclasses

wrapcloseterm(widget)[source]

A child terminal has closed, so this container must die

maker = None
position = None
ratio = 0.5
class terminatorlib.paned.VPaned[source]

Bases: terminatorlib.paned.Paned, gtk.VPaned

Merge gtk.VPaned into our base Paned Container

__init__()[source]

Class initialiser

get_length()[source]
set_pos(pos)[source]

terminatorlib.plugin module

plugin.py - Base plugin system
Inspired by Armin Ronacher’s post at http://lucumr.pocoo.org/2006/7/3/python-plugin-system Used with permission (the code in that post is to be considered BSD licenced, per the authors wishes)
>>> registry = PluginRegistry()
>>> registry.instances
{}
>>> registry.load_plugins(True)
>>> plugins = registry.get_plugins_by_capability('test')
>>> len(plugins)
1
>>> plugins[0] 
<testplugin.TestPlugin object at 0x...>
>>> registry.get_plugins_by_capability('this_should_not_ever_exist')
[]
>>> plugins[0].do_test()
'TestPluginWin'
class terminatorlib.plugin.MenuItem[source]

Bases: terminatorlib.plugin.Plugin

Base class for menu items

callback(menuitems, menu, terminal)[source]

Callback to transform the enclosed URL

capabilities = ['terminal_menu']
class terminatorlib.plugin.Plugin[source]

Bases: object

Definition of our base plugin class

__init__()[source]

Class initialiser.

unload()[source]

Prepare to be unloaded

capabilities = None
class terminatorlib.plugin.PluginRegistry[source]

Bases: terminatorlib.borg.Borg

Definition of a class to store plugin instances

__init__()[source]

Class initialiser

disable(plugin)[source]

Disable a plugin

enable(plugin)[source]

Enable a plugin

get_all_plugins()[source]

Return all plugins

get_available_plugins()[source]

Return a list of all available plugins whether they are enabled or disabled

get_plugins_by_capability(capability)[source]

Return a list of plugins with a particular capability

is_enabled(plugin)[source]

Return a boolean value indicating whether a plugin is enabled or not

load_plugins(testing=False)[source]

Load all plugins present in the plugins/ directory in our module

prepare_attributes()[source]

Prepare our attributes

available_plugins = None
done = None
instances = None
path = None
class terminatorlib.plugin.URLHandler[source]

Bases: terminatorlib.plugin.Plugin

Base class for URL handlers

__init__()[source]

Class initialiser

callback(url)[source]

Callback to transform the enclosed URL

unload()[source]

Handle being removed

capabilities = ['url_handler']
handler_name = None
match = None
namecopy = None
nameopen = None

terminatorlib.prefseditor module

Preferences Editor for Terminator.

Load a UIBuilder config file, display it, populate it with our current config, then optionally read that back out and write it to a config file

class terminatorlib.prefseditor.LayoutEditor(builder)[source]
__init__(builder)[source]

Initialise ourself

on_layout_item_selection_changed(selection)[source]

A different item in the layout was selected

on_layout_profile_chooser_changed(widget)[source]

A new profile has been selected for this item

on_layout_profile_command_activate(widget)[source]

A new command has been entered for this item

on_layout_profile_workingdir_activate(widget)[source]

A new working directory has been entered for this item

on_layout_selection_changed(selection)[source]

A different layout was selected

prepare(layout=None)[source]

Do the things we can’t do in __init__

set_layout(layout_name)[source]

Load a particular layout

set_layout_item(item_name)[source]

Set a layout item

update_profiles()[source]

Update the list of profiles

builder = None
config = None
layout_item = None
layout_name = None
profile_ids_to_profile = None
profile_profile_to_ids = None
treestore = None
treeview = None
class terminatorlib.prefseditor.PrefsEditor(term)[source]

Class implementing the various parts of the preferences editor

__init__(term)[source]
on_allow_bold_checkbutton_toggled(widget)[source]

Allow bold setting changed

on_alternate_screen_scroll_checkbutton_toggled(widget)[source]

Scroll in alt-mode setting changed

on_always_split_with_profile_toggled(widget)[source]

Always split with profile setting changed

on_alwaysontopcheck_toggled(widget)[source]

Always on top setting changed

on_antialias_checkbutton_toggled(widget)[source]

Anti-alias setting changed

on_audible_bell_checkbutton_toggled(widget)[source]

Audible bell setting changed

on_background_colorpicker_color_set(widget)[source]

Background color changed

on_background_image_filechooser_file_set(widget)[source]

Background image setting changed

on_background_type_toggled(_widget)[source]

The background type was toggled

on_backspace_binding_combobox_changed(widget)[source]

Backspace binding setting changed

on_broadcastdefault_changed(widget)[source]

Broadcast default changed

on_cellrenderer_accel_cleared(liststore, path)[source]

Handle the clearing of a keybinding accelerator

on_cellrenderer_accel_edited(liststore, path, key, mods, _code)[source]

Handle an edited keybinding

on_closebutton_clicked(_button)[source]

Close the window

on_color_scheme_combobox_changed(widget)[source]

Update the fore/background colour pickers

on_copy_on_selection_toggled(widget)[source]

Copy on selection setting changed

Cursor blink setting changed

on_cursor_color_color_set(widget)[source]

Cursor colour changed

on_cursor_shape_combobox_changed(widget)[source]

Cursor shape changed

on_custom_command_entry_changed(widget)[source]

Custom command value changed

on_custom_url_handler_entry_changed(widget)[source]

Custom URL handler value changed

on_darken_background_scale_change_value(widget, scroll, value)[source]

Background darkness setting changed

on_dbuscheck_toggled(widget)[source]

DBus server setting changed

on_delete_binding_combobox_changed(widget)[source]

Delete binding setting changed

on_encoding_combobox_changed(widget)[source]

Encoding setting changed

on_exit_action_combobox_changed(widget)[source]

Exit action changed

on_focuscombo_changed(widget)[source]

Focus type changed

on_font_selector_font_set(widget)[source]

Font changed

on_foreground_colorpicker_color_set(widget)[source]

Foreground color changed

on_handlesize_change_value(widget, scroll, value)[source]

Handle size changed

on_hidefromtaskbcheck_toggled(widget)[source]

Hide from taskbar setting changed

on_hideonlosefocuscheck_toggled(widget)[source]

Hide on lose focus setting changed

on_homogeneous_toggled(widget)[source]

homogeneous_tabbar setting changed

on_icon_bell_checkbutton_toggled(widget)[source]

Icon bell setting changed

on_inactive_color_offset_change_value(widget, scroll, value)[source]

Inactive color offset setting changed

on_layout_item_selection_changed(selection)[source]

A different item in the layout was selected

on_layout_name_edited(cell, path, newtext)[source]

Update a layout name

on_layout_profile_chooser_changed(widget)[source]

A different profile has been selected for this item

on_layout_profile_command_changed(widget)[source]

A different command has been entered for this item

on_layout_profile_workingdir_changed(widget)[source]

A different working directory has been entered for this item

on_layout_selection_changed(selection)[source]

A different layout was selected

on_layoutaddbutton_clicked(_button)[source]

Add a new layout to the list

on_layoutrefreshbutton_clicked(_button)[source]

Refresh the terminals status and update

on_layoutremovebutton_clicked(_button)[source]

Remove a layout from the list

on_login_shell_checkbutton_toggled(widget)[source]

Login shell setting changed

on_open_manual(widget)[source]

Open the fine manual

on_palette_colorpicker_color_set(widget)[source]

A palette colour changed

on_palette_combobox_changed(widget)[source]

Palette selector changed

on_plugin_selection_changed(selection)[source]

A different plugin was selected

on_plugin_toggled(cell, path)[source]

A plugin has been enabled or disabled

on_profile_name_edited(cell, path, newtext)[source]

Update a profile name

on_profile_selection_changed(selection)[source]

A different profile was selected

on_profileaddbutton_clicked(_button)[source]

Add a new profile to the list

on_profileremovebutton_clicked(_button)[source]

Remove a profile from the list

on_reset_compatibility_clicked(widget)[source]

Reset the confusing and annoying backspace/delete options to the safest values

on_scroll_background_checkbutton_toggled(widget)[source]

Scroll background setting changed

on_scroll_on_keystroke_checkbutton_toggled(widget)[source]

Scroll on keystrong setting changed

on_scroll_on_output_checkbutton_toggled(widget)[source]

Scroll on output setting changed

on_scroll_toggled(widget)[source]

scroll_tabbar setting changed

on_scrollback_infinite_toggled(widget)[source]

Scrollback infiniteness changed

on_scrollback_lines_spinbutton_value_changed(widget)[source]

Scrollback lines setting changed

on_scrollbar_position_combobox_changed(widget)[source]

Scrollbar position setting changed

on_show_titlebar_toggled(widget)[source]

Show titlebar setting changed

on_stickycheck_toggled(widget)[source]

Sticky setting changed

on_system_font_checkbutton_toggled(checkbox)[source]

Toggling the use_system_font checkbox needs to alter the sensitivity of the font selector

on_tabposcombo_changed(widget)[source]

Tab position changed

on_title_font_selector_font_set(widget)[source]

Titlebar Font changed

on_title_hide_sizetextcheck_toggled(widget)[source]

Window geometry setting changed

on_title_inactive_bg_color_color_set(widget)[source]

Title inactive background colour changed

on_title_inactive_fg_color_color_set(widget)[source]

Title inactive foreground colour changed

on_title_receive_bg_color_color_set(widget)[source]

Title receive background colour changed

on_title_receive_fg_color_color_set(widget)[source]

Title receive foreground colour changed

on_title_system_font_checkbutton_toggled(checkbox)[source]

Toggling the title_use_system_font checkbox needs to alter the sensitivity of the font selector

on_title_transmit_bg_color_color_set(widget)[source]

Title transmit backgruond colour changed

on_title_transmit_fg_color_color_set(widget)[source]

Title transmit foreground colour changed

on_update_records_checkbutton_toggled(widget)[source]

Update records setting changed

on_urgent_bell_checkbutton_toggled(widget)[source]

Window manager bell setting changed

on_use_custom_command_checkbutton_toggled(checkbox)[source]

Toggling the use_custom_command checkbox needs to alter the sensitivity of the custom_command entrybox

on_use_custom_url_handler_checkbutton_toggled(checkbox)[source]

Toggling the use_custom_url_handler checkbox needs to alter the sensitivity of the custom_url_handler entrybox

on_use_theme_colors_checkbutton_toggled(widget)[source]

Update colour pickers

on_visual_bell_checkbutton_toggled(widget)[source]

Visual bell setting changed

on_winbordercheck_toggled(widget)[source]

Window border setting changed

on_wingeomcheck_toggled(widget)[source]

Window geometry setting changed

on_winstatecombo_changed(widget)[source]

Window state changed

on_word_chars_entry_changed(widget)[source]

Word characters changed

set_layout(layout_name)[source]

Set a layout

set_plugin(plugin)[source]

Show the preferences for the selected plugin, if any

set_profile_values(profile)[source]

Update the profile values for a given profile

set_values()[source]

Update the preferences window with all the configuration from Config()

update_background_tab()[source]

Update the background tab

builder = None
colorschemevalues = {'green_on_black': 3, 'solarized_light': 7, 'custom': 9, 'black_on_yellow': 0, 'ambience': 6, 'solarized_dark': 8, 'white_on_black': 4, 'orange_on_black': 5, 'grey_on_black': 2, 'black_on_white': 1}
colourschemes = {'green_on_black': ['#00ff00', '#000000'], 'solarized_light': ['#657b83', '#fdf6e3'], 'black_on_yellow': ['#000000', '#ffffdd'], 'ambience': ['#ffffff', '#300a24'], 'solarized_dark': ['#839496', '#002b36'], 'white_on_black': ['#ffffff', '#000000'], 'orange_on_black': ['#e53c00', '#000000'], 'grey_on_black': ['#aaaaaa', '#000000'], 'black_on_white': ['#000000', '#ffffff']}
config = None
keybindingnames = {'cycle_prev': 'Focus the previous terminal', 'next_tab': 'Switch to the next tab', 'help': 'Open the manual', 'close_window': 'Close window', 'switch_to_tab_10': 'Switch to the tenth tab', 'resize_left': 'Resize the terminal left', 'full_screen': 'Toggle fullscreen', 'line_down': 'Scroll downwards one line', 'previous_profile': 'Switch to previous profile', 'rotate_ccw': 'Rotate terminals counter-clockwise', 'move_tab_left': 'Move the tab left', 'go_right': 'Focus the terminal right', 'go_left': 'Focus the terminal left', 'line_up': 'Scroll upwards one line', 'resize_right': 'Resize the terminal right', 'resize_down': 'Resize the terminal down', 'toggle_zoom': 'Maximise terminal', 'scaled_zoom': 'Zoom terminal', 'group_all_toggle': 'Group/Ungroup all terminals', 'page_down_half': 'Scroll downwards half a page', 'zoom_in': 'Increase font size', 'hide_window': 'Toggle window visibility', 'move_tab_right': 'Move the tab right', 'prev_tab': 'Switch to the previous tab', 'switch_to_tab_6': 'Switch to the sixth tab', 'switch_to_tab_7': 'Switch to the seventh tab', 'switch_to_tab_4': 'Switch to the fourth tab', 'switch_to_tab_5': 'Switch to the fifth tab', 'cycle_next': 'Focus the next terminal', 'switch_to_tab_3': 'Switch to the third tab', 'broadcast_off': "Don't broadcast key presses", 'switch_to_tab_1': 'Switch to the first tab', 'split_vert': 'Split vertically', 'group_tab': 'Group terminals in tab', 'switch_to_tab_8': 'Switch to the eighth tab', 'switch_to_tab_9': 'Switch to the ninth tab', 'page_down': 'Scroll downwards one page', 'insert_number': 'Insert terminal number', 'insert_padded': 'Insert padded terminal number', 'next_profile': 'Switch to next profile', 'zoom_out': 'Decrease font size', 'ungroup_all': 'Ungroup all terminals', 'broadcast_group': 'Broadcast key presses to group', 'switch_to_tab_2': 'Switch to the second tab', 'page_up': 'Scroll upwards one page', 'go_prev': 'Focus the previous terminal', 'layout_launcher': 'Open layout launcher window', 'group_tab_toggle': 'Group/Ungroup terminals in tab', 'page_up_half': 'Scroll upwards half a page', 'close_term': 'Close terminal', 'new_terminator': 'Spawn a new Terminator process', 'ungroup_tab': 'Ungroup terminals in tab', 'new_tab': 'Create a new tab', 'copy': 'Copy selected text', 'paste': 'Paste clipboard', 'reset': 'Reset the terminal', 'broadcast_all': 'Broadcast key events to all', 'search': 'Search terminal scrollback', 'go_up': 'Focus the terminal above', 'resize_up': 'Resize the terminal up', 'rotate_cw': 'Rotate terminals clockwise', 'split_horiz': 'Split horizontally', 'zoom_normal': 'Restore original font size', 'go_down': 'Focus the terminal below', 'new_window': 'Create a new window', 'edit_window_title': 'Edit window title', 'group_all': 'Group all terminals', 'go_next': 'Focus the next terminal', 'reset_clear': 'Reset and clear the terminal', 'toggle_scrollbar': 'Show/Hide the scrollbar'}
keybindings = None
layouteditor = None
palettes = {'rxvt': '#000000:#cd0000:#00cd00:#cdcd00:#0000cd:#cd00cd:#00cdcd:#faebd7:#404040:#ff0000:#00ff00:#ffff00:#0000ff:#ff00ff:#00ffff:#ffffff', 'xterm': '#000000:#cd0000:#00cd00:#cdcd00:#0000ee:#cd00cd:#00cdcd:#e5e5e5:#7f7f7f:#ff0000:#00ff00:#ffff00:#5c5cff:#ff00ff:#00ffff:#ffffff', 'tango': '#000000:#cc0000:#4e9a06:#c4a000:#3465a4:#75507b:#06989a:#d3d7cf:#555753:#ef2929:#8ae234:#fce94f:#729fcf:#ad7fa8:#34e2e2:#eeeeec', 'linux': '#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff', 'ambience': '#2e3436:#cc0000:#4e9a06:#c4a000:#3465a4:#75507b:#06989a:#d3d7cf:#555753:#ef2929:#8ae234:#fce94f:#729fcf:#ad7fa8:#34e2e2:#eeeeec', 'solarized': '#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3'}
palettevalues = {'rxvt': 3, 'xterm': 2, 'tango': 0, 'custom': 6, 'linux': 1, 'ambience': 4, 'solarized': 5}
plugins = None
previous_layout_selection = None
previous_profile_selection = None
registry = None
window = None
terminatorlib.prefseditor.color2hex(widget)[source]

Pull the colour values out of a Gtk ColorPicker widget and return them as 8bit hex values, sinces its default behaviour is to give 16bit values

terminatorlib.searchbar module

searchbar.py - classes necessary to provide a terminal search bar

class terminatorlib.searchbar.Searchbar[source]

Bases: gtk.HBox

Class implementing the Searchbar widget

__init__()[source]

Class initialiser

Trap and re-emit the clicked signal

Trap and re-emit the end-search signal

get_search_term()[source]

Return the currently set search term

get_vte()[source]

Find our parent widget

get_vte_buffer_range()[source]

Get the range of a vte widget

Search forwards and jump to the next result, if any

Jump back to the previous search

search_character(widget, col, row, junk)[source]

We have to have a callback for each character

search_hit(row)[source]

Update the UI for a search hit

search_keypress(widget, event)[source]

Handle keypress events

Show ourselves

wrap_toggled(toggled)[source]
config = None
entry = None
next = None
prev = None
reslabel = None
searchits = None
searchre = None
searchrow = None
searchstring = None
vte = None
wrap = None

terminatorlib.signalman module

Simple management of Gtk Widget signal handlers

class terminatorlib.signalman.Signalman[source]

Bases: object

Class providing glib signal tracking and management

__del__()[source]

Class destructor. This is only used to check for stray signals

__init__()[source]

Class initialiser

new(widget, signal, handler, *args)[source]

Register a new signal on a widget

remove_all()[source]

Remove all signal handlers for all widgets

remove_signal(widget, signal)[source]

Remove a signal handler

remove_widget(widget)[source]

Remove all signal handlers for a widget

cnxids = None

terminatorlib.terminal module

terminal.py - classes necessary to provide Terminal widgets

class terminatorlib.terminal.Terminal[source]

Bases: gtk.VBox

Class implementing the VTE widget and its wrappings

__init__()[source]

Class initialiser

check_for_url(event)[source]

Check if the mouse is over a URL

close()[source]

Close ourselves

connect_signals()[source]

Connect all the gtk signals and drag-n-drop mechanics

create_group(_item)[source]

Trigger the creation of a group via the titlebar (because popup windows are really lame)

create_layout(layout)[source]

Apply our layout

create_popup_group_menu(widget, event=None)[source]

Pop up a menu for the group widget

create_terminalbox()[source]

Create a GtkHBox containing the terminal and a scrollbar

deferred_on_vte_size_allocate(widget, allocation)[source]
describe_layout(count, parent, global_layout, child_order)[source]

Describe our layout

do_autocleangroups_toggle()[source]

Toggle the autocleangroups mode

do_deferred_on_vte_size_allocate(widget, allocation)[source]
do_scrollbar_toggle()[source]

Show or hide the terminal scrollbar

do_splittogroup_toggle()[source]

Toggle the splittogroup mode

ensure_visible_and_focussed()[source]

Make sure that we’re visible and focussed

feed(text)[source]

Feed the supplied text to VTE

force_set_profile(widget, profile)[source]

Forcibly set our profile

get_cursor_position()[source]

Return the co-ordinates of our cursor

get_cwd()[source]

Return our cwd

get_font_size()[source]

Return the width/height of our font

get_location(term, x, y)[source]

Get our location within the terminal

get_profile()[source]

Return our profile name

get_size()[source]

Return the column/rows of the terminal

get_vte()[source]

This simply returns the vte widget we are using

get_window_title()[source]

Return the window title

get_zoom_data()[source]

Return a dict of information for Window

grab_focus()[source]

Steal focus for this terminal

is_zoomed()[source]

Determine if we are a zoomed terminal

key_broadcast_all()[source]
key_broadcast_group()[source]
key_broadcast_off()[source]
key_close_term()[source]
key_copy()[source]
key_cycle_next()[source]
key_cycle_prev()[source]
key_edit_window_title()[source]
key_go_down()[source]
key_go_left()[source]
key_go_next()[source]
key_go_prev()[source]
key_go_right()[source]
key_go_up()[source]
key_group_all()[source]
key_group_all_toggle()[source]
key_group_tab()[source]
key_group_tab_toggle()[source]
key_help()[source]
key_insert_number()[source]
key_insert_padded()[source]
key_layout_launcher()[source]
key_line_down()[source]
key_line_up()[source]
key_move_tab_left()[source]
key_move_tab_right()[source]
key_new_terminator()[source]
key_new_window()[source]
key_next_profile()[source]
key_next_tab()[source]
key_page_down()[source]
key_page_down_half()[source]
key_page_up()[source]
key_page_up_half()[source]
key_paste()[source]
key_prev_tab()[source]
key_previous_profile()[source]
key_reset()[source]
key_reset_clear()[source]
key_resize_down()[source]
key_resize_left()[source]
key_resize_right()[source]
key_resize_up()[source]
key_rotate_ccw()[source]
key_rotate_cw()[source]
key_scaled_zoom()[source]
key_split_horiz()[source]
key_split_vert()[source]
key_switch_to_tab_1()[source]
key_switch_to_tab_10()[source]
key_switch_to_tab_2()[source]
key_switch_to_tab_3()[source]
key_switch_to_tab_4()[source]
key_switch_to_tab_5()[source]
key_switch_to_tab_6()[source]
key_switch_to_tab_7()[source]
key_switch_to_tab_8()[source]
key_switch_to_tab_9()[source]
key_toggle_scrollbar()[source]
key_toggle_zoom()[source]
key_ungroup_all()[source]
key_ungroup_tab()[source]
key_zoom_in()[source]
key_zoom_normal()[source]
key_zoom_out()[source]
match_add(name, match)[source]

Register a URL match

match_remove(name)[source]

Remove a previously registered URL match

maximise(widget=None)[source]

Maximise ourself to fill the window

on_beep(widget)[source]

Set the urgency hint for our window

on_buttonpress(widget, event)[source]

Handler for mouse events

on_drag_begin(widget, drag_context, _data)[source]

Handle the start of a drag event

on_drag_data_get(_widget, _drag_context, selection_data, info, _time, data)[source]

I have no idea what this does, drag and drop is a mystery. sorry.

on_drag_data_received(widget, drag_context, x, y, selection_data, _info, _time, data)[source]

Something has been dragged into the terminal. Handle it as either a URL or another terminal.

on_drag_motion(widget, drag_context, x, y, _time, _data)[source]

shrug

on_edit_done(_widget)[source]

A child widget is done editing a label, return focus to VTE

on_encoding_change(_widget, encoding)[source]

Handle the encoding changing

on_expose_event(widget, _event)[source]

Handle an expose event while dragging

on_group_button_press(widget, event)[source]

Handler for the group button

on_keypress(widget, event)[source]

Handler for keyboard events

on_mousewheel(widget, event)[source]

Handler for modifier + mouse wheel scroll events

on_search_done(_widget)[source]

We’ve finished searching, so clean up

on_vte_focus(_widget)[source]

Update our UI when we get focus

on_vte_focus_in(_widget, _event)[source]

Inform other parts of the application when focus is received

on_vte_focus_out(_widget, _event)[source]

Inform other parts of the application when focus is lost

on_vte_notify_enter(term, event)[source]

Handle the mouse entering this terminal

on_vte_size_allocate(widget, allocation)[source]
on_window_focus_out()[source]

Update our UI when the window loses focus

open_url(url, prepare=False)[source]

Open a given URL, conditionally unpacking it from a VTE match

paste_clipboard(primary=False)[source]

Paste one of the two clipboards

populate_group_menu()[source]

Fill out a group menu

popup_menu(widget, event=None)[source]

Display the context menu

position_popup_group_menu(menu, widget)[source]

Calculate the position of the group popup menu

prepare_url(urlmatch)[source]

Prepare a URL from a VTE match

really_create_group(_widget, groupname)[source]

The titlebar has spoken, let a group be created

reconfigure(_widget=None)[source]

Reconfigure our settings

scroll_by(amount)[source]

Scroll up or down by an amount of lines

scroll_by_line(lines)[source]

Scroll up or down in lines

scroll_by_page(pages)[source]

Scroll up or down in pages

scrollbar_jump(position)[source]

Move the scrollbar to a particular row

set_cursor_color()[source]

Set the cursor color appropriately

set_cwd(cwd=None)[source]

Set our cwd

set_font(fontdesc)[source]

Set the font we want in VTE

set_group(_item, name)[source]

Set a particular group

set_groupsend(_widget, value)[source]

Set the groupsend mode

set_profile(_widget, profile, force=False)[source]

Set our profile

spawn_child(widget=None, respawn=False, debugserver=False)[source]
switch_to_next_profile()[source]
switch_to_previous_profile()[source]
toggle_widget_visibility(widget)[source]

Show or hide a widget

ungroup(_widget, data)[source]

Remove a group

unzoom(widget=None)[source]

Restore normal layout

update_url_matches(posix=True)[source]

Update the regexps used to match URLs

zoom(widget=None)[source]

Zoom ourself to fill the window

zoom_font(zoom_in)[source]

Change the font size

zoom_in()[source]

Increase the font size

zoom_orig()[source]

Restore original font size

zoom_out()[source]

Decrease the font size

zoom_scale(widget, allocation, old_data)[source]

Scale our font correctly based on how big we are not vs before

TARGET_TYPE_VTE = 8
bgcolor = None
clipboard = None
cnxids = None
command = None
composite_support = None
config = None
custom_encoding = None
custom_font_size = None
cwd = None
default_encoding = None
directory = None
fgcolor_active = None
fgcolor_inactive = None
group = None
layout_command = None
matches = None
origcwd = None
palette_active = None
palette_inactive = None
pid = None
scrollbar = None
scrollbar_position = None
searchbar = None
targets_for_new_group = None
terminalbox = None
terminator = None
titlebar = None
vte = None

terminatorlib.terminal_popup_menu module

terminal_popup_menu.py - classes necessary to provide a terminal context menu

class terminatorlib.terminal_popup_menu.TerminalPopupMenu(terminal)[source]

Bases: object

Class implementing the Terminal context menu

__init__(terminal)[source]

Class initialiser

add_encoding_items(menu)[source]

Add the encoding list to the menu

show(widget, event=None)[source]

Display the context menu

config = None
terminal = None
terminator = None

terminatorlib.terminator module

terminator.py - class for the master Terminator singleton

class terminatorlib.terminator.Terminator[source]

Bases: terminatorlib.borg.Borg

master object for the application

__init__()[source]

Class initialiser

all_emit(terminal, type, event)[source]

Emit to all terminals

attempt_gnome_client()[source]

Attempt to find a GNOME Session to register with

closegroupedterms(group)[source]

Close all terminals in a group

create_group(name)[source]

Create a new group

create_layout(layoutname)[source]

Create all the parts necessary to satisfy the specified layout

deregister_launcher_window(window)[source]

de-register a launcher window widget

deregister_terminal(terminal)[source]

De-register a terminal widget

deregister_window(window)[source]

de-register a window widget

describe_layout()[source]

Describe our current layout

die(*args)[source]

Die at the hands of the session manager

do_enumerate(widget, pad)[source]

Insert the number of each terminal in a group, into that terminal

find_terminal_by_uuid(uuid)[source]

Search our terminals for one matching the supplied UUID

focus_changed(widget)[source]

We just moved focus to a new terminal

focus_left(widget)[source]
get_focussed_terminal()[source]

iterate over all the terminals to find which, if any, has focus

get_sibling_terms(widget)[source]
get_target_terms(widget)[source]

Get the terminals we should currently be broadcasting to

get_windows()[source]

Return a list of windows

group_emit(terminal, group, type, event)[source]

Emit to each terminal in a group

group_hoover()[source]

Clean out unused groups

layout_done()[source]

Layout operations have finished, record that fact

new_window(cwd=None)[source]

Create a window with a Terminal in it

prepare_attributes()[source]

Initialise anything that isn’t already

reconfigure()[source]

Update configuration for the whole application

register_launcher_window(window)[source]

Register a new launcher window widget

register_terminal(terminal)[source]

Register a new terminal widget

register_window(window)[source]

Register a new window widget

save_yourself(*args)[source]

Save as much state as possible for the session manager

set_dbus_data(dbus_service)[source]

Store the DBus bus details, if they are available

set_origcwd(cwd)[source]

Store the original cwd our process inherits

config = None
dbus_name = None
dbus_path = None
debug_address = None
doing_layout = None
gnome_client = None
groups = None
groupsend = None
groupsend_type = {'off': 2, 'all': 0, 'group': 1}
keybindings = None
last_active_window = None
launcher_windows = None
layoutname = None
origcwd = None
pid_cwd = None
terminals = None
windows = None
windowtitle = None

terminatorlib.titlebar module

titlebar.py - classes necessary to provide a terminal title bar

class terminatorlib.titlebar.Titlebar(terminal)[source]

Bases: gtk.EventBox

Class implementing the Titlebar widget

__init__(terminal)[source]

Class initialiser

connect_icon(func)[source]

Connect the supplied function to clicking on the group icon

create_group()[source]

Create a new group

editing()[source]

Determine if we’re currently editing a group name or title

get_custom_string()[source]

If we have a custom string set, return it, otherwise None

get_desired_visibility()[source]

Returns True if the titlebar is supposed to be visible. False if not

groupentry_activate(widget)[source]

Actually cause a group to be created

groupentry_cancel(widget, event)[source]

Hide the group name entry

groupentry_keypress(widget, event)[source]

Handle keypresses on the entry widget

icon_bell()[source]

A bell signal requires we display our bell icon

icon_bell_hide()[source]

Handle a timeout which means we now hide the bell icon

on_clicked(widget, event)[source]

Handle a click on the label

on_edit_done(widget)[source]

Re-emit an edit-done signal from an EditableLabel

set_custom_string(string)[source]

Set a custom string

set_from_icon_name(name, size=<enum GTK_ICON_SIZE_MENU of type GtkIconSize>)[source]

Set an icon for the group label

set_group_label(name)[source]

Set the name of the group

set_terminal_title(widget, title)[source]

Update the terminal title

update(other=None)[source]

Update our contents

update_terminal_size(width, height)[source]

Update the displayed terminal size

update_visibility()[source]

Make the titlebar be visible or not

bellicon = None
config = None
ebox = None
groupentry = None
groupicon = None
grouplabel = None
label = None
oldtitle = None
sizetext = None
terminal = None
terminator = None
termtext = None

terminatorlib.translation module

Terminator by Chris Jones <cmsj@tenshu.net>

terminatorlib.util module

Terminator.util - misc utility functions

terminatorlib.util.dbg(log='')[source]

Print a message if debugging is enabled

terminatorlib.util.dict_diff(reference, working)[source]

Examine the values in the supplied working set and return a new dict that only contains those values which are different from those in the reference dictionary

>>> a = {'foo': 'bar', 'baz': 'bjonk'}
>>> b = {'foo': 'far', 'baz': 'bjonk'}
>>> dict_diff(a, b)
{'foo': 'far'}
terminatorlib.util.enumerate_descendants(parent)[source]

Walk all our children and build up a list of containers and terminals

terminatorlib.util.err(log='')[source]

Print an error message

terminatorlib.util.gerr(message=None)[source]

Display a graphical error. This should only be used for serious errors as it will halt execution

terminatorlib.util.get_config_dir()[source]

Expand all the messy nonsense for finding where ~/.config/terminator really is

terminatorlib.util.get_edge(allocation, direction)[source]

Return the edge of the supplied allocation that we will care about for directional navigation

terminatorlib.util.get_nav_offset(edge, allocation, direction)[source]

Work out how far edge is from a particular point on the allocation rectangle, in the given direction

terminatorlib.util.get_nav_possible(edge, allocation, direction, p1, p2)[source]

Check if the supplied allocation is in the right direction of the supplied edge

terminatorlib.util.get_nav_tiebreak(direction, cursor_x, cursor_y, rect)[source]

We have multiple candidate terminals. Pick the closest by cursor position

terminatorlib.util.has_ancestor(widget, wtype)[source]

Walk up the family tree of widget to see if any ancestors are of type

terminatorlib.util.inject_uuid(target)[source]

Inject a UUID into an existing object

terminatorlib.util.make_uuid(str_uuid=None)[source]

Generate a UUID for an object

terminatorlib.util.manual_lookup()[source]

Choose the manual to open based on LANGUAGE

terminatorlib.util.path_lookup(command)[source]

Find a command in our path

terminatorlib.util.shell_lookup()[source]

Find an appropriate shell for the user

terminatorlib.util.spawn_new_terminator(cwd, args)[source]

Start a new terminator instance with the given arguments

terminatorlib.util.widget_pixbuf(widget, maxsize=None)[source]

Generate a pixbuf of a widget

terminatorlib.version module

TerminatorVersion by Chris Jones <cmsj@tenshu.net>

TerminatorVersion supplies our version number.

terminatorlib.window module

window.py - class for the main Terminator window

class terminatorlib.window.Window[source]

Bases: terminatorlib.container.Container, gtk.Window

Class implementing a top-level Terminator window

__init__()[source]

Class initialiser

add(widget, metadata=None)[source]

Add a widget to the window by way of gtk.Window.add()

apply_config()[source]

Apply various configuration options

apply_icon(requested_icon)[source]

Set the window icon

closeterm(widget)[source]

Handle a terminal closing

confirm_close(window, type)[source]

Display a confirmation dialog when the user is closing multiple terminals in one window

create_layout(layout)[source]

Apply any config items from our layout

deferred_set_rough_geometry_hints()[source]
do_deferred_set_rough_geometry_hints()[source]
do_get_property(prop)[source]

Handle gobject getting a property

do_set_property(prop, value)[source]

Handle gobject setting a property

get_children()[source]

Return a single list of our child

get_focussed_terminal()[source]

Find which terminal we want to have focus

get_visible_terminals()[source]

Walk down the widget tree to find all of the visible terminals. Mostly using Container::get_visible_terminals()

group_all(widget)[source]

Group all terminals

group_all_toggle(widget)[source]

Toggle grouping to all

group_tab(widget)[source]

Group all terminals in the current tab

group_tab_toggle(widget)[source]

Blah

hoover()[source]

Ensure we still have a reason to exist

is_child_notebook()[source]

Returns True if this Window’s child is a Notebook

move_tab(widget, direction)[source]

Handle a keyboard shortcut for moving tab positions

navigate_terminal(terminal, direction)[source]

Navigate around terminals

on_button_press(window, event)[source]

Handle a mouse button event. Mainly this is just a clean way to cancel any urgency hints that are set.

on_delete_event(window, event, data=None)[source]

Handle a window close request

on_destroy_event(widget, data=None)[source]

Handle window destruction

on_focus_in(window, event)[source]

Focus has entered the window

on_focus_out(window, event)[source]

Focus has left the window

on_hide_window(data=None)[source]

Handle a request to hide/show the window

on_key_press(window, event)[source]

Handle a keyboard event

on_window_state_changed(window, event)[source]

Handle the state of the window changing

register_callbacks()[source]

Connect the GTK+ signals we care about

remove(widget)[source]

Remove our child widget by way of gtk.Window.remove()

rotate(widget, clockwise)[source]

Rotate children in this window

set_always_on_top(value)[source]

Set the always on top window hint from the supplied value

set_borderless(value)[source]

Set the state of the window border from the supplied value

set_fullscreen(value)[source]

Set the fullscreen state of the window from the supplied value

set_groups(new_group, term_list)[source]

Set terminals in term_list to new_group

set_hidden(value)[source]

Set the visibility of the window from the supplied value

set_iconified(value)[source]

Set the minimised state of the window from the supplied value

set_maximised(value)[source]

Set the maximised state of the window from the supplied value

set_real_transparency(value=True)[source]

Enable RGBA if supported on the current screen

set_rough_geometry_hints()[source]

Walk all the terminals along the top and left edges to fake up how many columns/rows we sort of have

set_sticky(value)[source]

Set the sticky hint from the supplied value

show(startup=False)[source]

Undo the startup show request if started in hidden mode

split_axis(widget, vertical=True, cwd=None, sibling=None, widgetfirst=True)[source]

Split the window

tab_change(widget, num=None)[source]

Change to a specific tab

tab_new(widget=None, debugtab=False, _param1=None, _param2=None)[source]

Make a new tab

ungroup_all(widget)[source]

Ungroup all terminals

ungroup_tab(widget)[source]

Ungroup all terminals in the current tab

unzoom(widget)[source]

Restore normal terminal layout

zoom(widget, font_scale=True)[source]

Zoom a terminal widget

hidebound = None
hidefunc = None
ignore_startup_show = None
isfullscreen = None
ismaximised = None
last_active_term = None
losefocus_time = 0
position = None
set_pos_by_ratio = None
term_zoomed = False
terminator = None
title = None
zoom_data = None
class terminatorlib.window.WindowTitle(window)[source]

Bases: object

Class to handle the setting of the window title

__init__(window)[source]

Class initialiser

force_title(newtext)[source]

Force a specific title

set_title(widget, text)[source]

Set the title

update()[source]

Update the title automatically

forced = None
text = None
window = None

Module contents

Terminator by Chris Jones <cmsj@tenshu.net>