diff --git a/Mailnag/daemon/mailchecker.py b/Mailnag/daemon/mailchecker.py index b0810c4..023d568 100644 --- a/Mailnag/daemon/mailchecker.py +++ b/Mailnag/daemon/mailchecker.py @@ -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) diff --git a/README.md b/README.md index 0c28b23..4feda0b 100644 --- a/README.md +++ b/README.md @@ -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