Skip to content
Snippets Groups Projects
Commit 314342ad authored by Alexander Cherniuk's avatar Alexander Cherniuk
Browse files

Added an ability to execute a command when a new Gmail event arrives. Thanks...

Added an ability to execute a command when a new Gmail event arrives. Thanks to umonkey. Fixes #5818
parent bdd31f4c
No related branches found
No related tags found
No related merge requests found
...@@ -161,6 +161,7 @@ class Config: ...@@ -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 ...@@ -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: ...@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment