elementary / switchboard-plug-notifications

Switchboard Notifications Plug
GNU General Public License v2.0
9 stars 7 forks source link

Permit all Applications that Notify to be Configured #88

Open chrisdotcode opened 2 years ago

chrisdotcode commented 2 years ago

While elementary/notifications does indeed notify for all applications, the switchboard only allows applications that use GNOME notifications to be configured. This pull requests (in tandem with https://github.com/elementary/notifications/pull/162) keeps track of applications that do not explicitly send GNOME notifications - but still do send notifications - and allows them to be configured as well. Here's a screenshot of what this looks like on my machine (note Firefox, Ungoogled Chromium and Mailspring, which normally would not be present):

image

I was motivated to create this initially because gnome-power-panel shoots off untraceable notifications right before your laptop hibernates, and when you resume, it's almost impossible to realize that your notification came from gnome-power-panel (since it does not leave any notifications behind, and you can't turn them off, either). Furthermore, gnome-power-panel does not actually exist as an application on disk at all, and the desktop hint entry in the notification (gnome-power-panel) is different from whatever actual application is sending it (which I still haven't found). Nevertheless, there should be a way to configure notifications from gnome-power-panel (and other apps like it!) even though they technically doesn't exist: if they sends notifications, the switchboard should allow said notifications to be configured. Additionally, browser (and many, probably most flatpak apps, amongst others) notifications were not prior available before this PR, either. When this is finished, they will not only be displayed, but also fully configurable.

Since I am very new to Vala (and contributing to eOS), I don't know the proper idioms of the language, and when I've finished writing all of the code, I'll be sure to run through the coding guidelines and so forth. For now, I wanted the elementary team to see my work so far, and hopefully approve it and point me in the right direction for the rest of the code changes. More specifically, since the plug was initially designed for notifications with desktop files, I'll need to work through some plumbing to finish handling what I'm currently calling "dynamic" (as opposed to static) notifications/applications. Code requesting feedback is marked with "XXX", but please feel free to offer advice on other parts on the code as well.

Thanks!

chrisdotcode commented 2 years ago

Under further examination, "system" notifications (x-canonical-private-synchronous) don't have any way to have their notifications configured, but like "Other", maybe there should also be a catch-all category for them?

chrisdotcode commented 2 years ago

Hey, @danrabbit, it seems like you're responsible for most of the code in this module. Is it okay to ping you to get some feedback for progressing this - hopefully configuration for all applications that notify isn't something abhorrent to you, especially considering all applications have the ability to notify already, even if they haven't enable GNOME notifications? (And if not, could you perhaps offer some guidance on how I could finish this implementation so I could run this locally?)

All I need are some pointers on where to go next, and I have no problem continuing to implementing.