STFU if gnome-shell notifications are disabled

This commit is contained in:
Patrick Ulbrich
2012-04-21 18:13:07 +02:00
parent bdd7d5826f
commit 42a82b04d0
2 changed files with 8 additions and 3 deletions

View File

@@ -22,7 +22,7 @@
# MA 02110-1301, USA.
#
from gi.repository import Notify
from gi.repository import Notify, Gio
import threading
import sys
import subprocess
@@ -45,6 +45,7 @@ class MailChecker:
self._reminder = Reminder()
self._pid = Pid()
self._cfg = cfg
self._gsettings = Gio.Settings.new('org.gnome.shell')
# dict that tracks all notifications that need to be closed
self._notifications = {}
@@ -94,8 +95,11 @@ class MailChecker:
self._notify_summary(unseen_mails)
else:
self._notify_single(new_mails)
if self._cfg.get('general', 'playsound') == '1': # play sound?
# play sound if it is enabled in mailnags settings and
# gnome-shell notifications aren't disabled
if (self._cfg.get('general', 'playsound') == '1') and \
(self._gsettings.get_int('saved-session-presence') != 2):
gstplay(get_data_file(self._cfg.get('general', 'soundfile')))
self._reminder.save(self._mail_list)

View File

@@ -27,6 +27,7 @@ and translate Mailnag into your language!
pygobject-3
gir-notify
gir-gstreamer
gir-glib-2.0
python-httplib2
python2-gnomekeyring
pyxdg