From 314342ada2b0c22d42e70c2abdc74ec08c2066ba Mon Sep 17 00:00:00 2001 From: Alexander Cherniuk Date: Tue, 20 Jul 2010 20:15:44 +0300 Subject: [PATCH] Added an ability to execute a command when a new Gmail event arrives. Thanks to umonkey. Fixes #5818 --- src/common/config.py | 1 + src/gui_interface.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/common/config.py b/src/common/config.py index a450344e8..7f82a7258 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -161,6 +161,7 @@ class Config: 'after_nickname': [ opt_str, ':', _('Characters that are printed after the nickname in conversations') ], 'notify_on_new_gmail_email': [ opt_bool, True ], 'notify_on_new_gmail_email_extra': [ opt_bool, False ], + 'notify_on_new_gmail_email_command': [ opt_str, '', _('Specify the command to run when new mail arrives, e.g.: /usr/bin/getmail -q') ], 'use_gpg_agent': [ opt_bool, False ], 'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')], 'restore_lines': [opt_int, 4, _('How many lines to remember from previous conversation when a chat tab/window is reopened.')], diff --git a/src/gui_interface.py b/src/gui_interface.py index eaa872a99..e10011cfe 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -40,6 +40,7 @@ import sys import re import time import math +from subprocess import Popen import gtk import gobject @@ -1348,6 +1349,10 @@ class Interface: 'snippet': gmessage['Snippet']} cnt += 1 + command = gajim.config.get('notify_on_new_gmail_email_command') + if command: + Popen(command, shell=True) + if gajim.config.get_per('soundevents', 'gmail_received', 'enabled'): helpers.play_sound('gmail_received') notify.popup(_('New E-mail'), jid, account, 'gmail',