After using Linux Mint with Cinnamon for a long time I am now back with Ubuntu with GNOME (reluctantly, I may add).

One thing I have noticed is there does not seem to be an option in the settings to change your preferred terminal emulator.
Continue reading

I’ve been using the excellent terminal emulator Terminator for a long time. Terminator sports (among other things) split screen hand “cluster support” (grouping of screens, making it possible to type the same thing in all terminals).


In previous versions of Ubuntu (Terminator versions prior to 0.14) Terminator would pick all settings from GNOME Terminal, including character encoding (ISO-8859-15 in my case). Apparently this is no longer the case in Ubuntu 10.04, which has Terminator 0.14.

To use another encoding than UTF-8, add the following to ~/.config/terminator/config:

encoding = ISO-8859-15

Substitute ISO-8859-15 with whatever encoding you want.

Some other nice configuration options

scrollback_lines = 10000 # Scroll back size
focus = sloppy # sloppy focus, ie. the focus follows the mouse when moving the pointer to another split-screen

for more options, run man terminator_config.

I’m not going to dwell on the subject – The Ubuntu Design team (and in the end Mark Shuttleworth) decided to change the titlebar button layout as part of the new Light GNOME theme (which is a really nice theme); for more information read this article

Being the good Ubuntu fanboy that I am, I have really tried to embrace this new layout – But every time I move the mouse pointer to the right side of the window only to find the close button missing, I grew increasingly frustrated.

Luckily the fix is easy.

From a terminal (or from the run prompt, ALT-F2), run

gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close

I was pretty happy with solution to get notifications from Irssi though it had some shortcomings.

A couple of days ago a colleague made me aware of a Perl modules written by another colleague (Anton Berezin) called IPC::Message::Minivan which, it turns out, is perfect for my notification script. Basing the notifications on Minivan combine the speed of using something like Dbus locally (instant notifications) with the convenience of my previous script (notifications over the network, able to handle multiple clients).

This setup consists of three parts: The Minivan daemon, the Irssi script and the notification script.

As always my instructions are based on Ubuntu but should work on most Linux and Unix systems.

Installing the Minivan

IPC::Message::Minivan is not yet available directly through CPAN so we need to install it manually

  1. Download IPC::Messaging and IPC::Message::Minivan (and unpack them).
  2. Install dependencies: sudo apt-get install libjson-xs-perl libregexp-common-perl
  3. One could use dh-make-perl but I chose to install the two modules manually
    Basically run “perl && sudo make install
    :~/devel/IPC-Messaging-0.01_12$ perl Makefile.PL
    Cannot determine license info from lib/IPC/
    *** Module::AutoInstall version 1.03
    *** Checking for Perl dependencies...
    [Core Features]
    - Test::More                ...loaded. (0.72)
    - B::Generate               ...missing.
    - IO::Socket::UNIX          ...loaded. (1.23)
    - IO::Socket::INET          ...loaded. (1.31)
    - Storable                  ...loaded. (2.18)
    - Time::HiRes               ...loaded. (1.9711)
    - IO::Select                ...loaded. (1.17)
    - Module::Load::Conditional ...loaded. (0.22)
    ==> Auto-install the 1 mandatory module(s) from CPAN? [y] y
    *** Dependencies will be installed the next time you type 'make'.
        (You may need to do that as the 'root' user.)
    *** Module::AutoInstall configuration finished.
    Checking if your kit is complete...
    Looks good
    Warning: prerequisite B::Generate 0 not found.
    Writing Makefile for IPC::Messaging
    :~/devel/IPC-Messaging-0.01_12$ sudo make install
    [sudo] password for alj:
    /usr/bin/perl "-Iinc" Makefile.PL --config= --installdeps=B::Generate,0
    Cannot determine license info from lib/IPC/
    *** Installing dependencies...
    [MSG] No '/home/alj/.cpanplus/custom-sources' dir, skipping custom sources
    [MSG] No '/home/alj/.cpanplus/custom-sources' dir, skipping custom sources
    [MSG] No '/home/alj/.cpanplus/custom-sources' dir, skipping custom sources
    *** Installing B::Generate...
    Running [/usr/bin/perl /usr/bin/cpanp-run-perl /home/alj/.cpanplus/5.10.0/build/B-Generate-1.26/Makefile.PL INSTALLDIRS=site]...
    # running Build.PL installdirs=site
    /usr/bin/perl Build.PL installdirs=site
    Creating custom builder _build/lib/My/ in _build/lib/My
    Checking whether your kit is complete...
    Looks good

    Checking prerequisites...
    Looks good

    Creating new 'Build' script for 'B-Generate' version '1.26'
    Unknown 'build_class', defaulting to 'Module::Build'
    Running [/usr/bin/make test UNINST=1]...
    make[1]: Entering directory `/home/alj/.cpanplus/5.10.0/build/B-Generate-1.26'
    /usr/bin/perl Build --makefile_env_macros 1 test
            2/10 skipped: various reasons
    All tests successful, 2 subtests skipped.
    Files=6, Tests=721,  0 wallclock secs ( 0.24 cusr +  0.21 csys =  0.45 CPU)
    make[1]: Leaving directory `/home/alj/.cpanplus/5.10.0/build/B-Generate-1.26'

    *** B::Generate successfully installed.
    *** Module::AutoInstall installation finished.
    cp lib/IPC/ blib/lib/IPC/
    Manifying blib/man3/IPC::Messaging.3pm
    Installing /usr/local/share/perl/5.10.0/IPC/
    Installing /usr/local/man/man3/IPC::Messaging.3pm
    Writing /usr/local/lib/perl/5.10.0/auto/IPC/Messaging/.packlist
    Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod
    :~/devel/IPC-Message-Minivan-0.01_08$ perl Makefile.PL
    Cannot determine license info from lib/IPC/Message/
    Writing Makefile for IPC::Message::Minivan
    :~/devel/IPC-Message-Minivan-0.01_08$ sudo make install
    cp lib/IPC/Message/ blib/lib/IPC/Message/
    cp minivan blib/script/minivan
    /usr/bin/perl "-Iinc" "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/minivan
    Manifying blib/man1/minivan.1p
    Manifying blib/man3/IPC::Message::Minivan.3pm
    Installing /usr/local/share/perl/5.10.0/IPC/Message/
    Installing /usr/local/man/man1/minivan.1p
    Installing /usr/local/man/man3/IPC::Message::Minivan.3pm
    Installing /usr/local/bin/minivan
    Writing /usr/local/lib/perl/5.10.0/auto/IPC/Message/Minivan/.packlist
    Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod
  4. Create an Upstart script for the Minivan daemon
    $ cat /etc/init/minivan.conf
    # minivan - minimalistic message bus

    description     "minimalistic message bus"

    start on runlevel [2345]
    stop on runlevel [!2345]

    expect fork

    exec /usr/local/bin/minivan -l /var/log/minivan -d
  5. Start the Minivan daemon
    $ sudo start minivan

Install the Irssi script

  1. Copy the script to ~/.irssi/scripts/ (the script below is just for reference, it might not be up to date)
    ## Put me in ~/.irssi/scripts, and then execute the following in irssi:
    ##       /load perl
    ##       /script load notifier-minivan

    use strict;
    use Irssi;
    use vars qw($VERSION %IRSSI);
    use HTML::Entities;
    use IPC::Message::Minivan;

    $VERSION = "0.01";
    %IRSSI = (
        authors     => 'Allan Willems Joergensen',
        origauthors => 'Luke Macken, Paul W. Frields, Jared Quinn, Anton Berezin, Kristoffer Larsen',
        contact     => '[email protected],dk',
        name        => '',
        description => 'Alert the user of new messages or hilights through IPC::Message::Minivan',
        license     => 'Beerware',
        url         => '',

    # Default settings in Irssi
    Irssi::settings_add_str('notifier','minivan_host', 'localhost');
    Irssi::settings_add_str('notifier','minivan_port', 6826);

    # Fetch settings from Irssi
    my $minivan_host = Irssi::settings_get_str('minivan_host');
    my $minivan_port = Irssi::settings_get_str('minivan_port');
    my $minivan_channel = Irssi::settings_get_str('minivan_channel');

    # Connect to the Minivan
    our $van = IPC::Message::Minivan->new(host => $minivan_host, port => $minivan_port);

    sub notify {
        my ($server, $summary, $message) = @_;

        # Encode certain characters using HTML
        my $safemsg = HTML::Entities::encode($message, '<>&"');

        # Load everyone into the minivan
        $van->msg($minivan_channel, {summary => $summary, msg => $safemsg});

    sub print_text_notify {
        my ($dest, $text, $stripped) = @_;
        my $server = $dest->{server};
        return if (!$server || !($dest->{level} & MSGLEVEL_HILIGHT));
        my $sender = $stripped;
        $sender =~ s/^\<.([^\>]+)\>.+/\1/ ;
        $stripped =~ s/^\<.[^\>]+\>.// ;
        my $summary = "Hilite in " . $dest->{target};
        notify($server, $summary, $stripped);

    sub message_private_notify {
        my ($server, $msg, $nick, $address) = @_;
        return if (!$server);
        notify($server, "Private message from ".$nick, $msg);

    sub dcc_request_notify {
        my ($dcc, $sendaddr) = @_;
        my $server = $dcc->{server};

        return if (!$dcc);
        notify($server, "DCC ".$dcc->{type}." request", $dcc->{nick});

    Irssi::signal_add('print text', 'print_text_notify');
    Irssi::signal_add('message private', 'message_private_notify');
    Irssi::signal_add('dcc request', 'dcc_request_notify');
  2. Load the script inside Irssi: /script load
  3. If your Minivan is not running on the same machine as Irssi, change the configuration inside Irssi:
    /set minivan_host your_hostname – IPC::Message::Minivan is tunnel-able through ssh, see client configuration
  4. Auto-load the script:
    ln -sf ~/.irssi/scripts/ ~/.irssi/scripts/autoload/

The stuff running on your local machine

It is possible to use autossh to automatically setup the tunnel but since I am always connected to my server (at least when I am in front of a computer) I chose to use normal ssh port forwarding.

In ~/.ssh/config I have

Host my.server.bogus
        LocalForward 6826 localhost:6826

The stuff that actually shows the notifications

I did not want to bother trying to make the script error proof so I simply call the Perl script from a shell script like so


while true

    let wait=$wait+5
    if [ $wait -ge 30 ]
        sleep 30
        sleep $wait

Save the script as ~/bin/

The notification script requires Desktop::Notify – It is available in the Ubuntu repositories but it is an old version, so let’s use a newer:

$ sudo apt-get install dh-make-perl libnet-dbus-perl
$ cpan2deb Desktop::Notify
$ sudo dpkg -i ~/.cpan/libdesktop-notify-perl*.deb

The script


use strict;
use warnings;
use Desktop::Notify;
use IPC::Message::Minivan;
use Encode;

my $notify_timeout = 500;
my $icon = "/usr/share/pixmaps/pidgin/protocols/scalable/irc.svg";
#my $icon = "gnome-irc.png";

my $van = IPC::Message::Minivan->new(host => 'localhost');
our $notify = Desktop::Notify->new();
my $notification = $notify->create(summary => 'Minivan', body => 'Connection established', timeout => $notify_timeout, app_icon => $icon);

while (1) {
    if (my $cmd = $van->get(5,[])) {
        if ($cmd->[0] eq '#irssi') {
            my $c=$cmd->[1];
            my $message = Encode::encode("utf-8",$c->{msg});
            my $summary = $c->{summary};


Copy the script to ~/bin/

Remember to make both scripts executable.

The final thing to do is to add the notify client to your desktop environment’s autostart

In GNOME: System -> Preferences -> Startup Applications

Add Startup Program

Add Startup Program