Skip to content

Conversation

@chrisdotcode
Copy link

@chrisdotcode chrisdotcode commented Feb 2, 2022

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 elementary/notifications#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
Copy link
Author

chrisdotcode commented Feb 2, 2022

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
Copy link
Author

chrisdotcode commented Feb 4, 2022

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.

apps_that_have_notified.unset(app.normalized_app_id);
apps.@set (desktop_entry, app);
} else {
foreach (var entry in alternate_names.entries) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have forgotten to break early out of this loop if we match an alternate name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant