Skip to content

Instantly share code, notes, and snippets.

@eacousineau
eacousineau / scrub_notifications.py
Created November 25, 2020 22:15
Scrub / Filter out Ubuntu 18.04 Desktop Notifications (via D-Bus)
"""
Runs a DBus message loop with a callback to receive... pretty much
anything on a session bus.
Listen to the Notify event; if it's a message we hate, record it, then
listen for the return message, and kill that message.
Tested On:
- Ubuntu 18.04.5 LTS, CPython 3.6.9 (dbus: 1.2.6, gi: 3.26.1)
To test, try running the following with and without this script running: