[GH-ISSUE #7] Notification tray module #1412

Closed
opened 2026-05-22 22:52:09 +01:00 by JakeStanger · 11 comments
Owner

Originally created by @JakeStanger on GitHub (Aug 14, 2022).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/7

Would be cool to be able to connect to notification daemons and keep track of past notifications, displaying them in a popout panel/tray of sorts.

Originally created by @JakeStanger on GitHub (Aug 14, 2022). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/7 Would be cool to be able to connect to notification daemons and keep track of past notifications, displaying them in a popout panel/tray of sorts.
Author
Owner

@yffengdong commented on GitHub (Apr 7, 2023):

related issues: support SwayNotificationCenter
https://github.com/ErikReider/SwayNotificationCenter

<!-- gh-comment-id:1499939394 --> @yffengdong commented on GitHub (Apr 7, 2023): related issues: support SwayNotificationCenter https://github.com/ErikReider/SwayNotificationCenter
Author
Owner

@JakeStanger commented on GitHub (Apr 7, 2023):

This is probably the easiest way to go about it and something I've been considering for a while. I don't know if it's possible to hook into its daemon, but at the very least I can provide a (custom) module which opens it up.

<!-- gh-comment-id:1500202750 --> @JakeStanger commented on GitHub (Apr 7, 2023): This is probably the easiest way to go about it and something I've been considering for a while. I don't know if it's possible to hook into its daemon, but at the very least I can provide a (custom) module which opens it up.
Author
Owner

@yavko commented on GitHub (Jun 30, 2023):

This is probably the easiest way to go about it and something I've been considering for a while. I don't know if it's possible to hook into its daemon, but at the very least I can provide a (custom) module which opens it up.

From taking a 15.73 second peak at the codebase I can confirm it is possible, and it's done through dbus.

<!-- gh-comment-id:1615110153 --> @yavko commented on GitHub (Jun 30, 2023): > This is probably the easiest way to go about it and something I've been considering for a while. I don't know if it's possible to hook into its daemon, but at the very least I can provide a (custom) module which opens it up. From taking a 15.73 second peak at the codebase I can confirm it is possible, and it's done through dbus.
Author
Owner

@ErikReider commented on GitHub (Feb 11, 2024):

related issues: support SwayNotificationCenter ErikReider/SwayNotificationCenter

I'd be down to work with y'all on this for swaync! :)

<!-- gh-comment-id:1937785888 --> @ErikReider commented on GitHub (Feb 11, 2024): > related issues: support SwayNotificationCenter [ErikReider/SwayNotificationCenter](https://github.com/ErikReider/SwayNotificationCenter) I'd be down to work with y'all on this for swaync! :)
Author
Owner

@JakeStanger commented on GitHub (Feb 11, 2024):

Oh damn, the legend himself! That'd be really appreciated, thanks. I'll be coming to this issue soon-ish (read: within a few months) so now's actually a good time to really start planning the details on it.

My thoughts on this currently are that Ironbar shouldn't be treading on SwayNC's toes too much, and should only really be supplementing it with the bar integration. In real terms that means I see Ironbar being able to respond to new notifications and show info on the bar such as the latest notification or a total count, and provide a button which opens the notification panel. Communicating via dbus will work nicely.

I'm not sure if there's any other functionality I'm missing that people could see as useful?

<!-- gh-comment-id:1937800166 --> @JakeStanger commented on GitHub (Feb 11, 2024): Oh damn, the legend himself! That'd be really appreciated, thanks. I'll be coming to this issue soon-ish (read: within a few months) so now's actually a good time to really start planning the details on it. My thoughts on this currently are that Ironbar shouldn't be treading on SwayNC's toes too much, and should only really be supplementing it with the bar integration. In real terms that means I see Ironbar being able to respond to new notifications and show info on the bar such as the latest notification or a total count, and provide a button which opens the notification panel. Communicating via dbus will work nicely. I'm not sure if there's any other functionality I'm missing that people could see as useful?
Author
Owner

@ErikReider commented on GitHub (Feb 12, 2024):

In real terms that means I see Ironbar being able to respond to new notifications and show info on the bar such as the latest notification or a total count, and provide a button which opens the notification panel. Communicating via dbus will work nicely.

Swaync provides stable dbus methods that can easily be used by ironbar :)
image

Another thing would be to maybe export some GTK widgets as a library or something that others can use? So just attaching the "control center widget" to a popup on click? Not really sure about this though...

<!-- gh-comment-id:1938887513 --> @ErikReider commented on GitHub (Feb 12, 2024): > In real terms that means I see Ironbar being able to respond to new notifications and show info on the bar such as the latest notification or a total count, and provide a button which opens the notification panel. Communicating via dbus will work nicely. Swaync provides stable dbus methods that can easily be used by ironbar :) ![image](https://github.com/JakeStanger/ironbar/assets/35975961/b3c6db4e-5065-4926-93ae-916c9c0c351f) Another thing would be to maybe export some GTK widgets as a library or something that others can use? So just attaching the "control center widget" to a popup on click? Not really sure about this though...
Author
Owner

@JakeStanger commented on GitHub (Feb 16, 2024):

Good news about the dbus methods, looks like we're covered. I did have a good look at those before (as did Yakvo I assume) so good to have that reinforced.

Another thing would be to maybe export some GTK widgets as a library or something that others can use? So just attaching the "control center widget" to a popup on click? Not really sure about this though...

There could be an interesting approach to this, which would be to decouple the UI and daemon, perhaps allowing 3rd party UIs to more easily hook in. I'm not sure how feasible or beneficial or sensible that'd be though, especially given D-Bus is already an option. This could risk a crossing of the responsibilities of each program, unless I'm misunderstanding. My belief here is that swaync should be responsible for notifications, ironbar (or other) should be responsible for talking to it, and it should be kept to that strict server/client model.

If I've not quite grasped what you're suggesting or you've other ideas though I'm open to anything!

<!-- gh-comment-id:1949256719 --> @JakeStanger commented on GitHub (Feb 16, 2024): Good news about the dbus methods, looks like we're covered. I did have a good look at those before (as did Yakvo I assume) so good to have that reinforced. > Another thing would be to maybe export some GTK widgets as a library or something that others can use? So just attaching the "control center widget" to a popup on click? Not really sure about this though... There could be an interesting approach to this, which would be to decouple the UI and daemon, perhaps allowing 3rd party UIs to more easily hook in. I'm not sure how feasible or beneficial or sensible that'd be though, especially given D-Bus is already an option. This could risk a crossing of the responsibilities of each program, unless I'm misunderstanding. My belief here is that `swaync` should be responsible for notifications, `ironbar` (or other) should be responsible for talking to it, and it should be kept to that strict server/client model. If I've not quite grasped what you're suggesting or you've other ideas though I'm open to anything!
Author
Owner

@JakeStanger commented on GitHub (Mar 3, 2024):

@ErikReider I've succesfully managed to talk to SwayNC and can do the basics already 🎉 but the subscribe method seems fairly limited at the moment. It looks like it just comes back with the following bits:

<signal name="SubscribeV2">
  <arg type="u" name="count"/>
  <arg type="b" name="dnd"/>
  <arg type="b" name="cc_open"/>
  <arg type="b" name="inhibited"/>
</signal>

but as far as I can see there's no way to get the notification itself. Is there a way I'm missing, or is this something you think could be added (lmk and I can open an issue your end to track)?

<!-- gh-comment-id:1975231125 --> @JakeStanger commented on GitHub (Mar 3, 2024): @ErikReider I've succesfully managed to talk to SwayNC and can do the basics already :tada: but the subscribe method seems fairly limited at the moment. It looks like it just comes back with the following bits: ```xml <signal name="SubscribeV2"> <arg type="u" name="count"/> <arg type="b" name="dnd"/> <arg type="b" name="cc_open"/> <arg type="b" name="inhibited"/> </signal> ``` but as far as I can see there's no way to get the notification itself. Is there a way I'm missing, or is this something you think could be added (lmk and I can open an issue your end to track)?
Author
Owner

@JakeStanger commented on GitHub (Mar 3, 2024):

In the meantime, an initial implementation of the widget is pretty much ready to be shipped in the above PR.

<!-- gh-comment-id:1975384128 --> @JakeStanger commented on GitHub (Mar 3, 2024): In the meantime, an initial implementation of the widget is pretty much ready to be shipped in the above PR.
Author
Owner

@ErikReider commented on GitHub (Mar 3, 2024):

but as far as I can see there's no way to get the notification itself. Is there a way I'm missing, or is this something you think could be added (lmk and I can open an issue your end to track)?

Yeah, that's on purpose so that other applications can't snoop on the users notifications. Are there any other properties that you would like to be returned?

<!-- gh-comment-id:1975395625 --> @ErikReider commented on GitHub (Mar 3, 2024): > but as far as I can see there's no way to get the notification itself. Is there a way I'm missing, or is this something you think could be added (lmk and I can open an issue your end to track)? Yeah, that's on purpose so that other applications can't snoop on the users notifications. Are there any other properties that you would like to be returned?
Author
Owner

@JakeStanger commented on GitHub (Mar 4, 2024):

Oh that makes a lot of sense. Everything else I have covered, and to be honest the would-be-nice of the title makes less sense the more I think aobut it - notifications are obviously on screen, so why duplicate that on the bar?

<!-- gh-comment-id:1976893434 --> @JakeStanger commented on GitHub (Mar 4, 2024): Oh that makes a lot of sense. Everything else I have covered, and to be honest the would-be-nice of the title makes less sense the more I think aobut it - notifications are obviously on screen, so why duplicate that on the bar?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#1412
No description provided.