Evolution – Instancia Única

Bueno, desde hace un tiempo que venía buscando la forma de modificar el comportamiento de Evolution para que siempre utilice una única instancia.
Muchas veces me pasaba que entre tantas ventanas abiertas, me olvidaba que Evolution estaba minimizado y, al intentar abrirlo nuevamente desde el menú, en lugar de maximizar la instancia previamente activa, abría una nueva.

Para solucionar este comportamiento indeseado (por lo menos en mi caso) creé el siguiente script en Perl, basado en Evonotify [1].

# EvoLauncher was created by Lisandro Grassini
# based on Evonotify created by Oliver Grawert
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License

#!/usr/bin/perl
use Gnome2;
use Gnome2::Wnck;

Gtk2->init();

$stamp = time;
$screen = Gnome2::Wnck::Screen->get_default();

$screen->force_update();
foreach $window ($screen->get_windows()) {
if ($window->get_name =~ /Evolution/) {
$evolution = $window;
}
}

if($evolution) {
$evolution->unminimize($stamp);
$evolution->get_workspace->activate($stamp);
$evolution->activate($stamp);
print $evolution->get_geometry;
}
else {
system('evolution');
}

Gtk2->main_iteration() while (Gtk2->events_pending());
Gtk2->main();

[1] http://www.grawert.net/software/evonotify/index.html

Espero les sea útil como a mi.

Posted: August 10th, 2007 | Author: lichi | Filed under: linux | Tags: , , | 2 Comments »

2 Comments on “Evolution – Instancia Única”

  1. 1 AnnaHopn said at 6:03 am on February 5th, 2009:

    Greatings,
    I have already seen it somethere

    Thanks
    AnnaHopn

  2. 2 admin said at 1:37 pm on February 7th, 2009:

    sure… go ahead!


Leave a Reply