-
Notifications
You must be signed in to change notification settings - Fork 145
Add an on-closed event #578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…osed/dismissed. Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
I don't think users should configure mako to reload the state of indicators such as waybar. Instead, I think mako should provide APIs to allow indicators to subscribe to state changes, e.g. with a D-Bus event. |
Isn't the notification API already a dbus API? |
mako has two D-Bus APIs: the standard D-Bus one for applications submitting notifications, and a mako-specific one for makoctl and other tools. We already expose the current list of notifications there. We could add an event fired when a notification is added or dismissed. |
This sounds like something that would replace the current |
No: |
See #552 for an example of a D-Bus event approach, for modes. |
I'm not sure I understand the distinction, at least not in this case. Certainly if I was developing an application that depended on Mako then listening for DBus notifications is the way to go, it's a more efficient and cleaner design. But that isn't whats happening with Waybar, it doesn't have first-class support for any notification system so you have to configure it to call scripts which interrogate Mako (or whatever you are using), and your options are either poll or use unix signals to coordinate the state updates. Maybe there is a way to do that with DBus using a continuously running loop that sits on the bus and waits for notifications then emits JSON (I think this is supported by Waybar? Maybe worth a shot...) but either way I am approaching this as a user, at least for now. Also I don't necessarily want to derail this too much with discussions about Waybar, I think the on-dismissed notification could be useful for other things and it feels more like feature parity with the |
Let me also look at #552 and see if there's a similarly easy way to add a DBus event for notify and dismiss since I'm poking around anyway |
In some cases (for example, informing an external monitor like waybar) it can be useful to peform an action when a notification is closed/dismissed. This PR adds a
on-closed
event to allow mako users to take such an action.For example, to signal waybar to reload its state, the user could add:
See #550 for more details