# ROXTerm

## Contents

- Introduction
- Download
- Requirements
  - D-Bus
- Installing
- Debian
- User guide
  - Tabs
  - Menus
  - URI highlighting
  - Drag & Drop
  - Configuration
  - Command-line options
  - Advanced D-Bus use

## Introduction

ROXTerm is a terminal emulator intended to provide similar features to gnome-terminal, based on the same VTE library, but with a smaller footprint and quicker start-up time. It achieves this by not using the Gnome libraries and by using a separate applet to provide the configuration GUI. It can be used as a ROX application, as the name implies, or in any other X environment.

## Download

Visit the SourceForge project page to download release files or use other Sourceforge tools. If you want to get developmental versions ahead of releases, use subversion. Although there is a CVS repository it's obsolete. The actual command you will probably want to use to check out a snapshot is:

      svn co https://svn.sourceforge.net/svnroot/roxterm/trunk/roxterm ROXTerm

## Requirements

You need the libraries for GTK+2 which is pretty much standard on all free Unix derivatives these days. It definitely needs at least version 2.6 of glib and probably GTK+ 2.6 too. You will also need libglade 2 - usually, but not always installed; libvte, a Gnome component; and D-BUS (see below).

To compile ROXTerm you will need the header files for all the above libraries. In packaging systems they usually come in packages whose names end in "-dev" or "-devel".

Additionally, to build a subversion checkout of ROXTerm you need autoconf, automake and libtool. Use the latest versions possible. Old versions of automake (older than 1.7?) will cause building to fail because ROXTerm uses per-target CFLAGS.

### D-Bus

D-Bus is a messaging system which ROXTerm uses to connect terminals with its configure tool. ROXTerm uses the "session" bus, which should be started along with your desktop environment. Current versions of ROX, GNOME and KDE session managers all launch D-Bus. If you use some other session/desktop/window manager which doesn't launch D-Bus you can start it by inserting something like this near the start of your `.xinitrc` or `.xsession`:

      if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
        eval `dbus-launch --sh-syntax --exit-with-session`
        export DBUS_SESSION_BUS_ADDRESS
      fi

The reason for using a bespoke configuration messaging system over D-Bus instead of gconf is because gconf doesn't provide a way to map an arbitrary number of profiles onto configuration filenames.

## Installing

To install ROXTerm for ROX all you need to do is unpack the tarball in your Apps directory and run it from there, but you will probably want to rename the folder to ROXTerm. For other systems ROXTerm may be installed in the same way as any autoconf-based source package:

      ./configure
      make
      make install

## Debian

Thierry Randrianiriana is now maintaining official Debian packages so I am no longer providing any. See http://packages.debian.org/roxterm. However, I will try to make sure my debian module in subversion <http://roxterm.svn.sourceforge.net/svnroot/roxterm/trunk/debian/> remains valid in case anybody wants to build packages from versions newer than the most recent release.

## User guide

As a user of a terminal emulator you should not require much help, so this guide is very concise, covering just the more unusual features.

### Tabs

Each window can contain a number of tabs, each with its own terminal.

### Menus

The popup menu duplicates the same items as in the menu bar; this gives you full access to all the functions with the menu bar hidden. The menu bar is effectively redundant but provided to make ROXTerm appear more straightforward for first-time users. It can be turned on and off for a particular window or more permanently by using the configuration manager.

The popup menu also allows email and web addresses to be opened in external applications if such an address is highlighted by the pointer being over it.

### URI highlighting

When the pointer is over an address that ROXTerm recognises as a URI (typically a web URL or email address) it is highlighted by underlining and a change of pointer shape. You can open the address either by right-clicking on it and choosing `Open`... in the menu or by holding Ctrl and left-clicking. The applications used to handle these addresses may be set with the configuration tool, otherwise it will try to find a suitable default. Also by holding Ctrl you can drag a URI to pass it to another application which is willing to accept it as a URI or text; dragging it into the same window it came from pastes the address back in.

Note that if the pointer is over the server address portion of a URL it only highlights the address, omitting the filename; move the pointer over the filename to get the whole URL. Similarly you can highlight an email address with or without a leading `mailto:`.

### Drag & Drop

You can now drag items onto terminal windows. Text objects are fed to the terminal as if typed. Files and URIs have their location (filename or URI) fed in rather than the object's contents. Graphical files can also be dragged onto the appropriate area of the configuration manager to set terminal background images. Holding down Ctrl while dragging a highlighted URI allows the address to be dragged to another application.

You can now drag tabs by their labels to reorder them within a window or to move them to another ROXTerm window or, by dropping them outside a ROXTerm window, move tabs to new windows of their own. Use mouse button 3 (the right button) to move an unselected tab without selecting it. Note that versions prior to 1.9 used button 2 (middle). Button 2 is now a shortcut to paste the contents of the clipboard as the tab's name.

### Configuration

Configuration is based on named profiles so you can save different sets of options and switch between them quickly. There are profiles for general options, colour schemes and keyboard accelerators (also referred to as shortcuts). Colour schemes apply to one tab at a time, but Profiles and Keyboard accelerators apply to all tabs in the same window. New windows and tabs inherit settings from the window/tab they were opened from.

The Preferences menu allows you to select the current profile etc (this setting will not be remembered; use the configuration manager to set the defaults), open the configuration manager to edit the current profile or colour scheme or to manage all settings. In the configuration manager you can select one of the four types of option groups and edit, copy, delete or rename it. Each item also has a radio button. The item with the selected radio is the default for new terminals.

Note that character encodings are handled slightly differently and there is no editor for keyboard accelerators; instead they can be changed by pressing keys while the mouse is hovering over a menu item in the terminal, provided editable shortcuts are enabled in your desktop session. In GNOME check the "Editable menu shortcut keys" option in the Menus & Toolbars capplet.

You can also run the configuration manager by selecting "Configure..." in ROX's menu for the ROXTerm application or by running roxterm-config if ROXTerm has been installed conventionally.

Configuration files can easily be swapped with other users. Each profile, colour scheme and accelerator scheme has a single file associated with it; saving a valid file in the appropriate directory will create a profile etc with the same name as the file.

The directory locations for these configuration files follow the XDG Base Directory specification. In descending order of priority they are:

1. `${XDG_CONFIG_HOME}/roxterm.sourceforge.net` defaulting to `~/.config/roxterm.sourceforge.net`
2. `${XDG_CONFIG_DIRS}/roxtem.sourceforge.net` defaulting to `/etc/xdg/roxtem.sourceforge.net`
3. `ROXTerm/Config` for ROX users, or `${datadir}/roxterm/Config` for others; `${datadir}` is usually `/usr/share` for packages or `/usr/local/share` when compiled from source

Files will be loaded from any and all the above locations; files in high priority locations shadow ones with the same name in lower priority locations. Files are only saved in the first location.

Within any or each of those locations, profiles are saved in a "`Profiles`" subdirectory, colour schemes in "`Colours`" and keyboard shortcut schemes in "`Shortcuts`". A file called "`Globals`" contains miscellaneous options which don't fall into the above categories, including the default profile etc for new terminals.

### Command-line options

ROXTerm accepts a number of command-line options. Run

        roxterm --help

for a full list.

From version 1.1.0 ROXTerm defaults to using only one process for all terminals so that you can drag tabs between windows. If you run the command again it sends a D-BUS message to the existing process to signal it to open a new terminal, and the second process exits. To make a roxterm command run in its own separate process use the `--separate` option.

Note that the `--colour_scheme` and `--shortcut_scheme` options have been replaced by `--colour-scheme` and `--shortcut-scheme` respectively in 1.7.0 (underscores changed to hyphens) but the old versions remain usable for backwards compatibility.

### Advanced D-Bus use

From version 1.14.0 advanced users can use D-Bus to configure terminals from other applications and scripts. There are three D-Bus methods especially for this purpose; they require an id code to target a specific terminal; each terminal's id code can be read from the environment variable ROXTERM_ID in the shell/application running in it. The D-Bus object path and interface for the methods are "`net.sf.roxterm.Options`" and "`/net/sf/roxterm/Options`" respectively. The methods are:

SetProfile("id", "profile_name")
  Ask the terminal to use the named profile. Note that any other tabs in the same window will be updated to the same new profile. All tabs in one window must have the same profile so that their font size and therefore terminal size remain consistent.
SetColourScheme("id", "scheme_name")
  Ask the terminal to use the named colour scheme. Tabs sharing the same window may have different colour schemes from each other.
SetShortcutScheme("id", "scheme_name")
  Ask the terminal to use the named keyboard shortcut scheme. Tabs sharing the same window must also share the same shortcut scheme.

Example using dbus-send in a shell script:

    dbus-send --session /net/sf/roxterm/Options \
        net.sf.roxterm.Options.SetColourScheme string:$ROXTERM_ID string:GTK

You may also send D-Bus signals to change individual options within a named profile or colour scheme using the methods `StringOption`, `IntOption` (also used for boolean options) and `FloatOption`. All terminals using the named profile or colour scheme are affected, but only temporarily. The options are not saved for new terminals. The methods all take 3 arguments:

- Full profile name, including a prefix of "`Profiles/`" or "`Colours/`"
- Option name
- Value

To see which option names you can use, check the config files, from which the types can be deduced.

Example using dbus-send in a shell script:

    dbus-send --session /net/sf/roxterm/Options \
        net.sf.roxterm.Options.StringOption \
        string:Colours/GTK string:background 'string:#ffffff'