Skip to content
Gerald Nunn edited this page Aug 14, 2016 · 16 revisions

Introduction

Terminix supports the concept of triggers, these are regular expressions defined by the user that when matched against text output by the terminal trigger an action. A trigger consists of a regular expression, the action to execute and a parameter string. Depending on the action, the parameter can not be used at all, a single string or a semi-colon delimited list of variables.

The result of the regular expression can be referenced as tokens in the parameter, Terminix will substitute the tokens in the parameter prior to executing the action. The token $0 refers to the complete regular expression match. If groups were defined in the regular expression, the tokens $1, $2, $3, etc refer to the individual group captures.

Supported Actions

The following actions are supported by Terminix:

Action Description
Update State This action updates the state that Terminix maintains about the terminal in terms of things like what directory or hostname is currently active in the terminal. The variables username, hostname and directory can be used to update the state respectively, these represent . See further below for an example of how to use this.
Execute Command This action executes the command provided in the parameter field.
Send Notification Sends a notification to the desktop environment. Two variables are supported by this action, title and body.
Update Title Updates the terminal title using the parameter field, it sets the override title specified in Layout Options.

Examples

Here are some examples to help you use this feature:

Regular Express Action Parameter Description
^[(?P.)@(?P[-a-zA-Z0-9]) Update State username=$1;hostname=$2 Parses the username and hostname from a Linux prompt command that uses the following format: [username@hostname directory]$

How It Works