play alarm sound
This commit is contained in:
parent
7304929aa4
commit
2091b86c9d
@ -14,6 +14,8 @@
|
||||
#dbus-python
|
||||
]))
|
||||
|
||||
pkgs.libcanberra-gtk3
|
||||
|
||||
# Not sure if required
|
||||
#pkgs.glib
|
||||
#pkgs.gtk4
|
||||
|
@ -1,3 +1,5 @@
|
||||
import subprocess
|
||||
|
||||
import gi
|
||||
|
||||
from timer import Timer
|
||||
@ -30,6 +32,10 @@ class Application(Adw.Application):
|
||||
notification.add_button(label='Restart', detailed_action='app.restart-timer')
|
||||
self.send_notification(id=f'{self.get_application_id()}.{Timer.current_time()}', notification=notification)
|
||||
|
||||
# https://0pointer.de/public/sound-naming-spec.html
|
||||
sound_name = 'alarm-clock-elapsed'
|
||||
subprocess.run(['canberra-gtk-play', '-i', sound_name])
|
||||
|
||||
def on_notification_button_restart(self, _action: Gio.SimpleAction, _other: None):
|
||||
self.window.restart()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user