/k3rmit

A VTE-based terminal emulator that aims to be simple, fast and effective.

Primary LanguageCGNU General Public License v3.0GPL-3.0

k3rmit Release

AUR License

A VTE-based terminal emulator that aims to be simple, fast and effective.

Kermit the Frog

VTE is a GTK widget that allows creating a virtual terminal emulator which is used in many emulators such as GNOME Terminal, ROXTerm and evilvte. Although there's a lot of (VTE-based and other) terminal emulator options for GNU/Linux users, k3rmit tries to differ from them with its simplicity.
The project inspired by Vincent Bernat's article and also his implementation of a custom VTE-based terminal. Also, Rxvt and termite's appearance are taken as an example.

Installation

k3rmit terminal depends on vte3 and gtk3 packages.

• AUR (k3rmit-git)

• CMake

mkdir -p build && cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
sudo ldconfig

• Make

make
sudo make install

• GCC

cd src/
gcc -s -O3 -Wall -Wno-deprecated-declarations $(pkg-config --cflags vte-2.91) k3rmit.c -o\
 k3rmit.o $(pkg-config --libs vte-2.91)

Features

  • Use default shell (with $SHELL environment variable)
  • Supports transparency with a composite manager (such as compton)
  • Tab support
  • Customizable

Arguments

k3rmit [-h] [-v] [-d] [-c config] [-e command]
-h, show help message and exit
-v, show version
-d, enable debug messages
-c, configuration file to read
-e, command to execute in terminal

Key Bindings

Key Action
ctrl-alt-[c] copy to clipboard
ctrl-alt-[v] paste from clipboard
ctrl-alt-[t] open a new tab
ctrl-alt-[r] reload configuration file
ctrl-alt-[q] exit the terminal
ctrl-[up] increase font size
ctrl-[down] decrease font size
ctrl-[=] reset font size to default
ctrl-[return] open a new tab
ctrl-[num] switch to the tab number [num]
ctrl-[right][pgup] switch to the next tab
ctrl-[left][pgdn] switch to the previous tab
ctrl-[w][backspace] close the selected tab

• Key bindings (ctrl-alt) can be set to standard ctrl-shift with the config file.

• Default key bindings (ctrl-alt) can conflict with your desktop environments window shortcuts. (especially on Linux Mint) In order to solve this issue, key bindings can be changed to ctrl-shift.

Customization

Config File

k3rmit looks for configuration file in ~/.config/k3rmit.conf
The default configuration file is available here.
Most of the settings can be changed via the config file including font, opacity and colors.

Font

k3rmit uses a PangoFontDescription which retrieved from the k3rmit.conf for changing the font family, style and size. The configuration entry format of the font and some examples are shown below and the default value is monospace 9.

font [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]

FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace separated list of words where each WORD describes one of style, variant, weight, or stretch, and SIZE is an decimal number (size in points).

• Available font families: Normal, Sans, Serif and Monospace.
• Available styles: Normal, Oblique, Italic.
• Available weights: Ultra-Light, Light, Normal, Bold,Ultra-Bold, Heavy.
• Available variants: Normal, Small-Caps.
• Available stretch styles: Ultra-Condensed, Extra-Condensed, Condensed, Semi-Condensed, Normal, Semi-Expanded, Expanded, Extra-Expanded, Ultra-Expanded.

Examples:

font sans bold 12
font normal 10
font monospace bold italic condensed 12

Key Bindings

Custom keys and associated commands can be specified with the configuration file. An example entry is available here and entry format is shown below.

bind/bindx [KEY]~"[COMMAND]"

• bind: Send command to the terminal.
• bindx: Send command to the terminal and execute.
• Key bindings must be uppercase if the action key is ctrl-shift.
• Commands that contain "~" might have cause error when parsing the configuration file.

Examples:

bindx l~"ls -l"
bindx f~"df -h"
bind r~"rm -i "
bind p~"ps aux | grep "
bind k~"kill -9 "

Padding

In order to change the padding of the terminal, create ~/.config/gtk-3.0/gtk.css if does not exist and specify the values there and restart the terminal.

VteTerminal,
TerminalScreen,
vte-terminal {
    padding: 3px 2px 2px 1px;
}

The command below can be used to create both configuration files.

curl https://raw.githubusercontent.com/KeyLo99/k3rmit/master/.config/k3rmit.conf --output ~/.config/k3rmit.conf && \
printf "VteTerminal,\nTerminalScreen,\nvte-terminal {\n\tpadding: 3px 2px 2px 1px;\n}\n" > ~/.config/gtk-3.0/gtk.css

Screenshots

Screenshot I

Screenshot II

Screenshot III

v1.0: http://www.youtube.com/watch?v=mkr0RhUXf50

TODO(s)

• URL handling

License

GNU General Public License v3. (see gpl)

Credit

Copyright (C) 2019 by KeyLo99 https://www.github.com/KeyLo99