Skip to main content

Terminator D-Bus

ci documentation pypi version gitter

Python library to interact with Terminator through D-Bus.

Installation

pip install terminator-dbus

With uv:

uv tool install terminator-dbus

dbus-python needs the D-Bus development files when no system package or wheel is available.

Usage

Create one client and reuse it for all calls:

from terminator_dbus import Terminator

terminator = Terminator()
terminal = terminator.get_focused_terminal()

if terminal is not None:
    new_terminal = terminator.vsplit(
        terminal,
        {"execute": "htop", "title": "Processes"},
    )
    terminator.switch_profile(new_terminal, {"profile": "work"})

The client uses the current X11 or Wayland display by default. Pass display if the current environment does not identify the correct display:

terminator = Terminator(display=":1")

Pass bus_name when you already know the complete D-Bus service name:

terminator = Terminator(bus_name="net.tenshu.Terminator2...")

dbus.DBusException reports connection and remote method failures. Terminator itself returns strings that start with ERROR: for some tab and split failures.

D-Bus interface

This package follows the interface in Terminator 2.1.6 ipc.py.

  • Base service and interface name: net.tenshu.Terminator2
  • Object path: /net/tenshu/Terminator2
  • Display-specific name: the base name followed by the MD5 digest of the GDK display name

Terminator removes the screen suffix before it creates the digest. Thus, :0 and :0.0 use the same service name.

The Terminator class exposes every method in the service:

Python method D-Bus input Purpose Result
new_window_cmdline(options) a{ss} Create a window from serialized command-line options. None
new_tab_cmdline(options) a{ss} Create a tab from serialized command-line options. None
toggle_visibility_cmdline(options) a{ss} Toggle all window visibility. None
unhide_cmdline(options) a{ss} Show all hidden windows. None
new_window() empty Create a window. New terminal UUID or error string
new_tab(uuid) v Create a tab in a terminal's window. New terminal UUID or error string
reload_configuration() empty Reload configuration for all terminals. None
bg_img_all(options) v Set all background images from the file option. None
bg_img(uuid, options) vv Set one background image from the file option. None
hsplit(uuid, options=None) vv Split a terminal horizontally. New terminal UUID or error string
vsplit(uuid, options=None) vv Split a terminal vertically. New terminal UUID or error string
get_terminals() empty Get all terminal UUIDs. list[str]
get_focused_terminal() empty Get the focused terminal UUID. str | None
get_window(uuid) v Get a terminal's window UUID. str
get_window_title(uuid) v Get a terminal's window title. str
get_tab(uuid) v Get a terminal's tab identifier. str | None
get_tab_title(uuid) v Get a terminal's tab title. str | None
set_tab_title(uuid, options) vv Set a tab title from the tab-title option. None
switch_profile(uuid, options) vv Set one profile from the profile option. None
switch_profile_all(options) v Set all profiles from the profile option. None

Terminator does not assign identifiers to tabs. Its get_tab method returns an empty string for a terminal in a notebook.

The four *_cmdline methods require string-to-string dictionaries. The window and tab creation methods require the complete option mapping from Terminator's command-line parser.

Terminator does not declare D-Bus output signatures. dbus-python infers each output signature from the value returned by the service method.

Sponsors

Metadata

Release files for terminator-dbus 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terminator-dbus 0.1.1
File Size Uploaded
terminator_dbus-0.1.1.tar.gz 33.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for terminator-dbus 0.1.1
File Interpreter ABI Platform
terminator_dbus-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 46.3 kB

Release files / terminator_dbus-0.1.1.tar.gz

Download URL terminator_dbus-0.1.1.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
66c7f21167d784ba8e0444eee49de9a60eb3fdcc3acd95207c1651ceb03ef650
BLAKE2b-256 checksum
How to use checksums
ac713b7620a779c232b24dff3f834265065f6cb375be6407cf1722e295ad360b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / terminator_dbus-0.1.1-py3-none-any.whl

Download URL terminator_dbus-0.1.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdaf96c677237235f2871548c339cbe713e4a53dc6cc579351714aee26a4b87f
BLAKE2b-256 checksum
How to use checksums
aa8fc3e51facebab1f700d76e7739c67ecf3493cf2786b837b5aeea63eeb8c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page