diff --git a/ctabus/__main__.py b/ctabus/__main__.py index 40cf163..47ee919 100644 --- a/ctabus/__main__.py +++ b/ctabus/__main__.py @@ -119,6 +119,7 @@ def show( } text_to_show = config.format(**format_dict) if do_gui and enable_notifications: + notification_module.nm.setup_exiter(EXIT) notification_module.nm.set_title("Bustimes") notification_module.nm.say(text_to_show) diff --git a/ctabus/ui/notification.py b/ctabus/ui/notification.py index 2aa4b92..9f7427e 100644 --- a/ctabus/ui/notification.py +++ b/ctabus/ui/notification.py @@ -1,9 +1,18 @@ +from ctabus.internal.config import state_dir from ctabus.internal.notification import NotificationManager, HAS_NOTIFICATION class CTABUSNotifictaionManager(NotificationManager): + def __init__(self, workdir=state_dir): + super().__init__(workdir) + self.exiter = None + + def setup_exiter(self, exiter): + if self.exiter is None: + self.exiter = exiter + def on_done(self): - EXIT.set() + self.exiter.set() if HAS_NOTIFICATION: