core.terminal module

Handles terminal detection on Linux and terminal command lines.

class core.terminal.CustomTerminal[source]

Bases: LinuxTerminal

Allows custom terminal commands to handle missing cases.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'Custom command'
class core.terminal.GNOMETerminal[source]

Bases: LinuxTerminal

Handles terminals on GNOME and Cinnamon (e.g. gnome-terminal).

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'GNOME/Cinnamon'
class core.terminal.KDETerminal[source]

Bases: LinuxTerminal

Handles terminals on KDE (e.g. Konsole).

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'KDE'
class core.terminal.LXDETerminal[source]

Bases: LinuxTerminal

Handles terminals in LXDE.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'LXDE'
class core.terminal.LinuxTerminal[source]

Bases: object

Class for detecting and launching using a dedicated terminal on Linux.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = '????'
class core.terminal.MateTerminal[source]

Bases: LinuxTerminal

Handles the Mate desktop environment using mate-terminal.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'Mate'
class core.terminal.XfceTerminal[source]

Bases: LinuxTerminal

Handles terminals in the Xfce desktop environment.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'Xfce'
core.terminal.configure_custom_terminal(new_path)[source]

Configures the custom command used to launch a terminal on Linux.

core.terminal.configure_terminal(termname)[source]

Configures the terminal class used to launch a terminal on Linux.

core.terminal.get_configured_terminal()[source]

Retrieves the configured terminal command.

core.terminal.get_custom_terminal_cmd()[source]

Returns the command used by the custom terminal.

core.terminal.get_terminal_command(cmd, force_custom=False)[source]

Returns a command to launch <cmd> in a new terminal. On Linux, if force_custom is set, the custom terminal command will be used.

core.terminal.get_valid_terminals()[source]

Gets the terminals that are available on this system.

class core.terminal.i3Terminal[source]

Bases: LinuxTerminal

Handles terminals in the i3 desktop environment.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'i3'
class core.terminal.rxvtTerminal[source]

Bases: LinuxTerminal

Handles rxvt and urxvt terminals. urxvt is used if both are available.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = '(u)rxvt'
core.terminal.terminal_configured()[source]

Returns True if a terminal has been set up.

core.terminal.terminal_test_child(t)[source]

Tests the child side of terminal launching.

core.terminal.terminal_test_parent(t)[source]

Tests the parent side of terminal launching.

core.terminal.terminal_test_run(status_callback=None)[source]

Starts and manages the test of terminal launching. Intermittent status messages may be received on function <status_callback>. Return value is (a, b), where a is a boolean marking the success of the test and b is a status text describing the result.

class core.terminal.xtermTerminal[source]

Bases: LinuxTerminal

Handles the xterm terminal.

static detect()[source]

Detects if this terminal is available.

static get_command_line()[source]

Returns a subprocess-compatible command to launch a command with this terminal. If the command to be launched should go somewhere other than the end of the command line, use $ to indicate the correct place.

name = 'xterm'