Added an ability to execute a command when a new Gmail event arrives. Thanks to umonkey. Fixes #5818
This commit is contained in:
parent
bdd31f4cd7
commit
314342ada2
|
@ -161,6 +161,7 @@ class Config:
|
||||||
'after_nickname': [ opt_str, ':', _('Characters that are printed after the nickname in conversations') ],
|
'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': [ opt_bool, True ],
|
||||||
'notify_on_new_gmail_email_extra': [ opt_bool, False ],
|
'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 ],
|
'use_gpg_agent': [ opt_bool, False ],
|
||||||
'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')],
|
'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.')],
|
'restore_lines': [opt_int, 4, _('How many lines to remember from previous conversation when a chat tab/window is reopened.')],
|
||||||
|
|
|
@ -40,6 +40,7 @@ import sys
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import math
|
import math
|
||||||
|
from subprocess import Popen
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
@ -1348,6 +1349,10 @@ class Interface:
|
||||||
'snippet': gmessage['Snippet']}
|
'snippet': gmessage['Snippet']}
|
||||||
cnt += 1
|
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'):
|
if gajim.config.get_per('soundevents', 'gmail_received', 'enabled'):
|
||||||
helpers.play_sound('gmail_received')
|
helpers.play_sound('gmail_received')
|
||||||
notify.popup(_('New E-mail'), jid, account, 'gmail',
|
notify.popup(_('New E-mail'), jid, account, 'gmail',
|
||||||
|
|
Loading…
Reference in New Issue