diff --git a/shell.nix b/shell.nix index c3d98bf..4b64691 100644 --- a/shell.nix +++ b/shell.nix @@ -14,6 +14,8 @@ #dbus-python ])) + pkgs.libcanberra-gtk3 + # Not sure if required #pkgs.glib #pkgs.gtk4 diff --git a/src/dndbuster/app.py b/src/dndbuster/app.py index 522449a..ffeb9e1 100644 --- a/src/dndbuster/app.py +++ b/src/dndbuster/app.py @@ -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()