From 8880af7215d5fabcf8dd542298c93ead6192af93 Mon Sep 17 00:00:00 2001 From: Abhorrent_Anger Date: Mon, 21 Oct 2019 14:14:15 +0300 Subject: [PATCH] Working sound --- main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) mode change 100644 => 100755 main.py diff --git a/main.py b/main.py old mode 100644 new mode 100755 index 599e16d..6eece4d --- a/main.py +++ b/main.py @@ -1,7 +1,8 @@ #!/usr/bin/python3 import notify2 +import gtk from time import sleep -#from playsound import playsound +from playsound import playsound NAME = 'Eye Strain Reminder' MESSAGE = 'Friendly reminder to observe the 20-20-20 rule' @@ -15,14 +16,16 @@ def uninit(): notify2.uninit() def send_notification(): - #playsound('files/default.mp3') - notification = notify2.Notification(NAME, MESSAGE) + notification = notify2.Notification(NAME, MESSAGE, "notification-device-eject") + + #notification.set_icon_from_pixbuf(gtk.Label().render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_LARGE_TOOLBAR)) notification.set_timeout(TIMEOUT * MILLISECOND) notification.set_urgency(notify2.URGENCY_LOW) notification.show() + playsound('files/default.wav') sleep(TIMEOUT) notification.close() - #playsound('files/default.mp3') + playsound('files/default.wav') if __name__ == '__main__': init()