@@ -276,23 +276,27 @@ def calculate(self):
276
276
for time in PrayerTimes :
277
277
if time == NotifTime :
278
278
Notify .init ("Silaty" )
279
- notif = Notify .Notification ().new ('Get Ready' ,'%s minutes left until the %s prayer.' % (str (int (self .options .notification_time )),NextPrayer ), 'silaty' )
279
+ notif = Notify .Notification .new ('Get Ready' , '%s minutes left until the %s prayer.' % (str (int (self .options .notification_time )), NextPrayer ))
280
+ icon = GdkPixbuf .Pixbuf .new_from_file (os .path .dirname (os .path .realpath (__file__ )) + "/icons/hicolor/128x128/apps/silaty.svg" )
281
+ notif .set_icon_from_pixbuf (icon )
280
282
notif .set_app_name ('Silaty' )
281
283
notif .show ()
282
- if time == Time :
284
+ elif time == Time :
283
285
Notify .init ("Silaty" )
284
- notif = Notify .Notification .new ('Prayer time for %s' % CurrentPrayer ,"It's time for the %s prayer." % (CurrentPrayer ), 'silaty' )
286
+ notif = Notify .Notification .new ('Prayer time for %s' % CurrentPrayer ,"It's time for the %s prayer." % (CurrentPrayer ))
287
+ icon = GdkPixbuf .Pixbuf .new_from_file (os .path .dirname (os .path .realpath (__file__ )) + "/icons/hicolor/128x128/apps/silaty.svg" )
288
+ notif .set_icon_from_pixbuf (icon )
285
289
286
290
if self .options .audio_notifications == True :
287
291
if CurrentPrayer == 'Fajr' :
288
- uri = "file://" + os .path .dirname (os .path .realpath (__file__ ))+ "/audio/Fajr/" + self .options .fajr_adhan + ".ogg"
292
+ uri = "file://" + os .path .dirname (os .path .realpath (__file__ ))+ "/audio/Fajr/" + self .options .fajr_adhan + ".ogg"
289
293
self .fajrplayer = Gst .ElementFactory .make ("playbin" , "player" )
290
294
fakesink = Gst .ElementFactory .make ("fakesink" , "fakesink" )
291
295
self .fajrplayer .set_property ('uri' , uri )
292
296
self .fajrplayer .set_property ("video-sink" , fakesink )
293
297
self .fajrplayer .set_state (Gst .State .PLAYING )
294
298
else :
295
- uri = "file://" + os .path .dirname (os .path .realpath (__file__ ))+ "/audio/Normal/" + self .options .normal_adhan + ".ogg"
299
+ uri = "file://" + os .path .dirname (os .path .realpath (__file__ ))+ "/audio/Normal/" + self .options .normal_adhan + ".ogg"
296
300
self .normalplayer = Gst .ElementFactory .make ("playbin" , "player" )
297
301
fakesink = Gst .ElementFactory .make ("fakesink" , "fakesink" )
298
302
self .normalplayer .set_property ('uri' , uri )
@@ -361,10 +365,10 @@ def fill_zeros(time):
361
365
def to_hrtime (var ):
362
366
"""var: double -> human readable string of format "%I:%M:%S %p" """
363
367
time = ''
364
- hours = int (var ) #cast var (initially a double) as an int
368
+ hours = int (var ) # cast var (initially a double) as an int
365
369
366
- # If Division by 12 = 0, it's morning, else afternoon
367
- if hours // 12 == 0 :
370
+ # If Division by 24 = 0, it's morning, else afternoon
371
+ if hours // 24 == 0 :
368
372
zone = "AM"
369
373
else :
370
374
zone = "PM"
0 commit comments