-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for sound-name and suppress-sound hints #124
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Can we add settings for this in the demo app please?
@danrabbit I added tests for category, sound-name, and suppress-sound to the demo app. Since GLib.Notification doesn't support those hints, I added a new section for tests that specifically use libnotify. I would have replaced GLib.Notification for Notify.Notification, but the latter doesn't support all 4 priority states or notification ids. |
I'm kind of hesitant about adding features that are outside the scope of GLib.Notification. I'm worried about scope creep but also what our recommendation is to developers who want to use the full set of supported features. As far as I know, LibNotify doesn't require apps to identify themselves, which is pretty problematic in terms of the notification center and allowing users to control if notifications are sent at all. The notifications specification linked is out of date. Probably a more up-to-date spec is the notification portal spec, but realistically the library itself kind of is the spec currently. If there are additional features here that we want to support, I wonder if it would be worth pursuing a Granite.Notification class so that we have a recommendation for developers who want to use these features |
Yeah, it's definitely an interesting/difficult place to be. Flatpak'd applications seem to be a bit more restricted with the notifications portal. Whereas any non-sandboxed application have access to more powerful notification options, particularly hints that allow for controlling notification sound and image options. To get it all in one place, I've compiled the different combinations below. FreeDesktop.org Notification SpecThe FreeDesktop.org specification lists the following components: LibnotifyLibnotify.Notification seems to most closely match the the FD.o specification, supporting all but Portal / GLib.NotificationThe notification portal and GLib.Notification support a subset of the FD.o spec, with an added urgency level: And exclude support for: |
Expanding just a bit more (sorry for the notification spam),
If we want to add support for these hints to the notification server, should we first create Granite.Notification with access to the expanded notification options? |
AppCenter is all Flatpak now and our recommended sideload method is via Flatpak, so I think it's reasonable that we focus on what's possible/recommended from inside Flatpak. Yeah there's been kind of a lot of upstream discussion about notification sounds with no real resolution as far as I remember: https://gitlab.gnome.org/GNOME/glib/-/issues/1340 I imagine the expectation is that apps now send a You wouldn't need to set |
it still possible to add |
That's good to know. It looks like there ~200 applications in Flathub that are using this. I definitely think it'd be a step backwards to reduce support to just GLib.Notification's feature scope. |
I agree that supporting more of the FDO spec is desirable in order to accomodate existing apps using these features. If a Granite.Notification class can make it easier so much the better - we can just recommend developers use that. Ideally should not need an explicit extra dependency on |
The notification specification defines some additional hints for sounds.
This PR adds support for sound-name and suppress-sound. Supporting sound-file may be a bit more involved since Canberra doesn't seem to natively support files.
Testing sound-name (and category to verify no breakage) can be done with
notify-send
:Testing suppress-sound is trickier since notify-send doesn't support boolean hints.