Lei Mao bio photo

Lei Mao

Machine Learning, Artificial Intelligence. On the Move.

Twitter Facebook LinkedIn GitHub   G. Scholar E-Mail RSS

Introduction

Gnome Terminator is a local terminal emulator which allows multiple terminal sub-windows inside a large window. Because with Gnome Terminator, we will be less likely to open a new terminal window, it is likely to increase our working efficiency on Linux.


In this blog post, I am going to introduce how to setup customized default layouts for Gnome Terminators.

Installation

We could install Gnome Terminator using one line of command on Ubuntu.

$ sudo apt install terminator

Layout Setup

I will use my favorite layouts as an example to show how to setup a customized default layouts for Gnome Terminator, so that every time you open Gnome Terminator, the layouts will always be the one you feel the most comfortable with.


My favorite layout is displayed below. I like to have four terminal windows. One of them is running htop and the other one is running nvidia-smi dmon. In this way, I could monitor the usage of my CPU, GPU, memory, etc.

Gnome Terminator Layout

One of the benefits of using Gnome Terminator is that you don’t have to memorize and use short-cuts to setup the layout. There are generally two ways to setup the layout, clicking mouse and using configuration file.

Mouse Clicking

In the right-click menu, we fine-tune the layout by clicking Split Horizontally and Split Vertically. Once the layout is finalized, we click Preference.


It is recommended to maximize the window so that you will not feel the letters are too small in the split windows.

Maximize Window

Create profiles for terminals running htop and nvidia-smi dmon under the Profiles tab, respectively. To keep the terminal useful even after stopping htop and nvidia-smi dmon, we add ; bash after htop and nvidia-smi dmon. Also remember to choose Hold the terminal open when command exists.

htop Terminal Profiles
nvidia-smi dmon Terminal Profiles

Create layouts under the Layouts tab. The configurations of the layout we just fine-tuned would be imported automatically. We double click the name of the new layout and change it to default. We also change the terminal profiles to the htop and nvidia-smi dmon profiles we have just created. Do not forget to click Save. The new default layout will be conflicting to the old default layout. After closing the Gnome Terminator, we restart the program. The old default layout will be abandoned and the new default layout becomes the default one.

Add Layouts
Set Terminal Profiles in Layouts

Importing Configuration File

All the configurations will be stored in the ~/.config/terminator/config file. So it is equivalent to configure the layouts by modifying the configuration file. The configuration file of the settings we have done in the mouse clicking section is also provided below.

$ cat ~/.config/terminator/config
[global_config]
  window_state = maximise
[keybindings]
[layouts]
  [[default]]
    [[[child0]]]
      fullscreen = False
      last_active_term = 76191a62-6770-458d-a39f-4749d681e9f5
      last_active_window = False
      maximised = True
      order = 0
      parent = ""
      position = 67:27
      size = 1853, 1025
      title = leimao@leimao-evolvx: ~
      type = Window
    [[[child1]]]
      order = 0
      parent = child0
      position = 924
      ratio = 0.5
      type = HPaned
    [[[child2]]]
      order = 0
      parent = child1
      position = 512
      ratio = 0.501960784314
      type = VPaned
    [[[child5]]]
      order = 1
      parent = child1
      position = 512
      ratio = 0.501960784314
      type = VPaned
    [[[terminal3]]]
      order = 0
      parent = child2
      profile = default
      type = Terminal
      uuid = 76191a62-6770-458d-a39f-4749d681e9f5
    [[[terminal4]]]
      order = 1
      parent = child2
      profile = default
      type = Terminal
      uuid = d538eae0-7c50-4eae-9b5f-469406d58aab
    [[[terminal6]]]
      order = 0
      parent = child5
      profile = htop
      type = Terminal
      uuid = 5ca25170-d241-4993-a018-c004abbdd15b
    [[[terminal7]]]
      order = 1
      parent = child5
      profile = nvidia-smi
      type = Terminal
      uuid = 1e48a43f-93a4-46c0-b29e-4094c045673a
  [[New Layout]]
    [[[child0]]]
      fullscreen = False
      last_active_term = 76191a62-6770-458d-a39f-4749d681e9f5
      last_active_window = True
      maximised = True
      order = 0
      parent = ""
      position = 67:27
      size = 1853, 1025
      title = leimao@leimao-evolvx: ~
      type = Window
    [[[child1]]]
      order = 0
      parent = child0
      position = 924
      ratio = 0.5
      type = HPaned
    [[[child2]]]
      order = 0
      parent = child1
      position = 512
      ratio = 0.501960784314
      type = VPaned
    [[[child5]]]
      order = 1
      parent = child1
      position = 512
      ratio = 0.501960784314
      type = VPaned
    [[[terminal3]]]
      order = 0
      parent = child2
      profile = default
      type = Terminal
      uuid = 76191a62-6770-458d-a39f-4749d681e9f5
    [[[terminal4]]]
      order = 1
      parent = child2
      profile = default
      type = Terminal
      uuid = d538eae0-7c50-4eae-9b5f-469406d58aab
    [[[terminal6]]]
      order = 0
      parent = child5
      profile = htop
      type = Terminal
      uuid = 5ca25170-d241-4993-a018-c004abbdd15b
    [[[terminal7]]]
      order = 1
      parent = child5
      profile = nvidia-smi
      type = Terminal
      uuid = 1e48a43f-93a4-46c0-b29e-4094c045673a
[plugins]
[profiles]
  [[default]]
    cursor_color = "#aaaaaa"
  [[htop]]
    cursor_color = "#aaaaaa"
    custom_command = htop; bash
    exit_action = hold
    use_custom_command = True
  [[nvidia-smi]]
    cursor_color = "#aaaaaa"
    custom_command = nvidia-smi dmon; bash
    exit_action = hold
    use_custom_command = True

Notes

  • Gnome Terminator is Gnome based application. Therefore, unlike Tmux, it could not be used in a non-Gnome environment, such as SSH terminal.