Tabbed terminal emulation with Mrxvt

Juggling Shells


Tired of too many terminal windows? Mrxvt is a tab-based terminal tool that lets you manage several sessions in a single window.

By Andreas Kneib

froodmat, photocase.com

Mrxvt is an efficient terminal emulation tool that is independent of the standard Linux toolkits and desktops. The Mrxvt terminal tool has many useful features, but one of the more interesting attributes is its tab-oriented design. Mrxvt lets you maintain several terminal sessions in a single window and click the tabs to move between sessions.

You can download Mrxvt from the project website [1]. The site also has configuration tips and details about the program's features. The download section includes links to source code and prebuilt binary packages for distributions such as SUSE, Fedora, or Debian.

The Mrxvt website offers both the stable release 0.4.2 and the developer version 0.5.2. The developer version has trouble displaying transparent windows or windows with backgrounds, but it more than makes up for this with extra features in the terminal menu and with shortcuts. If you prefer to avoid experimenting, install the stable version to get started; otherwise, I recommend the newer release.

If you are not sure which prebuilt package you need, or if would like to install Mrxvt in your home directory for a trial run, see the "Installing from the Source Code" sidebar.

Installing from the Source Code

Start by unpacking the tarball and then change to the directory created by this step:

tar xvzf mrxvt-0.4.2.tgz
cd mrxvt-0.4.2/

If you will be installing the unstable developer version 0.5.2 instead of version 0.4.2, don't forget to apply the patch found in the download section of the Mrxvt website. The patch disables the debug output that was inadvertently left switched on in the developer version, which will obviously boost the performance:

patch -p0 < <I>path/<I>no_debug_x.patch

Next, type ./configure --help | less to list the build options for Mrxvt. If you will just be testing the software, it makes sense to install in your home directory. Type ./configure --prefix=/home/<User>/mrxvt to configure the source code, and then make and make install to compile and install, respectively.

At the Command Line

Like any other terminal emulator, Mrxvt understands various command-line options. For example, the following command takes you back in time, giving you a window with a black background (-bg black) and a green foreground font (-fg MediumSpringGreen):

mrxvt -fg  MediumSpringGreen -bg black

The program also offers transparent backgrounds with two approaches to enabling them. -tr enables pseudo-transparency, with -shade setting the shading intensity. The -tint option rounds off the show by adding color:

mrxvt -tr -tint red -shade 20

For genuine transparency, you need to set the Mrxvt -o option, followed by a percentage to specify the intensity. If you set -o 15, for example, you can quite easily see the contours of the applications behind the terminal window on the desktop. This level of transparency will not affect your work in the terminal. To use this feature, you will need X server version 6.8.1 or newer with the composite extension enabled and xcompmgr.

What you immediately notice about the terminal is the row of tabs. You can click the buttons next to the tabs to open a new tab with a shell running in it. Clicking the button with the red "X" closes an existing tab. Clicking the arrow buttons scrolls through the active terminals (Figure 1). If you prefer to use the keyboard, Mrxvt supports keyboard shortcuts for all of these actions. Table 1 lists some of them. For more information, check out the manpage by typing man mrxvt.

Figure 1: One of the more useful Mrxvt features is the tab-oriented design.

Another of the terminal's special features is its use of Freetype fonts. The maintainers disable this option by default. To enable the fonts, pass the --enable-xft option in while configuring the source code. You can then use a new option to set the font. The -xft switch tells the program to use Freetype fonts, and the -xftfn option tells Mrxvt which font to use (Luxi Mono, in the example):

mrxvt -xft -xftfn "Luxi Mono"

Mrxvt can use a different background image for each of the tabs. The parameter for enabling this is -vt#.pixmap file, where # specifies the terminal number, starting with zero:

mrxvt -vt0.
pixmap image_
zero.jpg
-vt1.pixmap
image_one.jpg

The software doesn't only give you the ability to configure the terminal window. If needed, you can use different colors to highlight the active and inactive tabs:

mrxvt -tabfg
AntiqueWhite -tabbg
 DarkSlateGray -itabbg DarkMagen
ta -itabfg Purple

These options are easy to interpret: -tabbg refers to the background of an active tab and -tabfg defines the foreground color. The counterparts for inactive tabs are -itabbg and -itabfg.

As you will see if you read the manpage for the program, many more parameters disable the scroll boxes and tab bar, enable transparency, assign background graphics, or move the scroll boxes and tab bar to the other side of the window. To display the menu bar for Mrxvt, enable the menu by passing the --enable-menubar option in during configuration. The -showmenu command displays the menu, and the -menu switch tells the program the path to the menu file:

mrxvt -showmenu -menu ~/mrxvt-0.
4.2/doc/menu/menu

Various sample configurations for the menu bar are available in the /mrxvt-0.4.2/doc/menu/ directory. If you are using Mrxvt 0.5.2 rather than the stable version, the files will be located in the mrxvt-0.5.2/share/ directory or in /etc/mrxvt/ for a global installation.

Configuration

Instead of using command-line parameters to configure the program, you can create a .mrxvtrc configuration file in your home directory. Using the syntax of the .Xdefaults and .Xresources files, enter the required values for window size, number of tabs, or font.

If the terminal emulator fails to find a .mrxvtrc file in your home directory, it will parse its configuration - if it exists - in the .Xdefaults and .Xresources files in the same directory. Mrxvt version 0.5.2 also uses global defaults in /etc/mrxvt. Listing 1 gives examples for various defaults.

Listing 1: Default Examples
01 mrxvt*font: -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-15
02 mrxvt*background: AntiqueWhite
03 mrxvt*foreground: #603100
04 mrxvt*geometry: 90x40
05 mrxvt*initTermNumber: 3
06 mrxvt*vt0*tabTitle: zsh
07 mrxvt*vt1*tabTitle: mc
08 mrxvt*vt2*tabTitle: mutt
09 mrxvt*vt0*command: /usr/bin/zsh -ls
10 mrxvt*vt1*command: /usr/bin/zsh -c mc
11 mrxvt*vt2*command: /usr/bin/zsh -c mutt
12 mrxvt*color0: black
13 mrxvt*color1: red3
14 mrxvt*color2: green4
15 mrxvt*color3: #bda106
16 mrxvt*color4: blue2
17 mrxvt*color5: magenta3
18 mrxvt*color6: cyan4
19 mrxvt*color7: AntiqueWhite

Conclusions

If you frequently use the command line and enjoy the convenience and attractive looks that Mrxvt gives you, it is definitely worth giving the terminal emulator a trial run.

You'll find that the Mrxvt program is a lightweight alternative to the KDE Konsole and Gnome Terminal, and the program also impresses with its versatile configuration options.

INFO
[1] Project homepage: http://materm.sourceforge.net