notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Records (all) Applications that Send Notifications

Open chrisdotcode opened this issue 2 years ago • 7 comments

In tandem with https://github.com/elementary/switchboard-plug-notifications/pull/88 (so please read that one first), this PR lays the groundwork for dynamic applications to be recorded.

The method used is that all applications that send a notification are recorded here, and will be later filtered and processed once the switchboard notifications plug is opened. My reasoning for putting very little processing in this code itself is because I care about my battery life: notifications are sent many more times than the switchboard is open, and so it's much faster to just modify a single gsetting here, and do necessary processing when the switchboard gets opened. This also explains the implementation: initially I had a "not known" applications list, and a "known applications list", but it 1. added more complexity to the code than was needed and 2. using a single list is completely sufficient here, since in the switchboard, we fetch all of the applications anyway, so we can do filtering there.

Additionally, the has-app setting is used to note whether or not the desktop entry in a given notification hint actually corresponds to a specific desktop entry on disk (gnome-power-panel is one such counterexample: it sends notifications as gnome-power-panel, but no such gnome-power-panel exists on disk that I could find).

Once again, please point me in the right direction eOS team, and I'll be happy to keep working on this!

chrisdotcode avatar Feb 02 '22 10:02 chrisdotcode