How can I temporarily filter-out certain notification-bubbles coming from specific sources?

... but it looks like a lot of work ...

It's not really too bad, at least for a crude generic solution.

Here is a copy of the details from my answer to last year's (sept 2012) post in

How to disable notification from network-manager.

dbus-monitor "interface='org.freedesktop.Notifications'"                \
| grep --line-buffered  'string "NetworkManager"'                       \
| sed -u -e  's/.*/killall notify-osd/g'                                \
| bash

Replace string "NetworkManager" with the desired RE to determine blocking.

To get an idea of what RE pattern match to look for run:
dbus-monitor "interface='org.freedesktop.Notifications'"
and look at the output while the notifications are popping-up.

ie. to remove notify-send messages also, use this grep line instead:

| grep --line-buffered  'string "NetworkManager"\|string "notify-send"'  \

Caveat:
killall notify-osd is non-discriminating and completely wipes the notification stack of any pending messages irregardless of whether NetworkManager or notify-send is the notifying agent.

An "honest" solution needs to account for possible race conditions when between determining a notification purge is needed and then doing doing it, another notification comes in that should pop-up and not be purged with the rest.

Also, if notifications are pending when the offending one to be blocked comes in, they will all be purged. This situation can at least be solved by making a copy of the dbus pending notifications and then reissue the desired ones with notify-send after the purge.

This is a bit of manually labour intensive work!

Ideally, the direct dbus use of

method void org.freedesktop.Notifications.CloseNotification(uint id)     [1]

to specifically target just the desired notifications, is unfortunately not obvious ... however ...

Another answer
Can org.freedesktop.Notifications.CloseNotification(uint id) be triggered and invoked via DBus?
shows how to use [1], at least with notify-send, but unfortunately not for arbitrary notifying aps. though some aps. have custom interfaces to control pop-up notifications.

cross refs.:

  • How to disable notification from network-manager
  • Is it possible to block NotifyOSD for one application?
  • filter messages to "notification area" applet
  • How can I customize/disable notification bubbles?

You may be able to filter this at the d-bus level, but it looks like a lot of work. First see this post to get insight into how osd operates

  • Listening to incoming libnotify notifications using DBus

Start up dbus-monitor before you send the run 'notify-send' on a separate console.

method call sender=:1.2450 -> dest=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.freedesktop.Notifications"
method call sender=:1.2450 -> dest=:1.41 serial=6 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=GetServerInformation
method return sender=:1.41 -> dest=:1.2450 reply_serial=6
   string "notify-osd"
   string "Canonical Ltd"
   string "1.0"
   string "1.1"
method call sender=:1.2450 -> dest=:1.41 serial=7 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "notify-send"
   uint32 0
   string "/usr/share/pixmaps/debian-logo.png"
   string "My Title"
   string "Some text body"
   array [
   ]
   array [
      dict entry(
         string "urgency"
         variant             byte 1
      )
   ]
   int32 -1

notify-osd does live on dbus

dpkg -L notify-osd
/usr/share/dbus-1/services/org.freedesktop.Notifications.service

but there's no additional constraints for this service in /etc/dbus-1/system.d

So you might be able to make a config file that can filter out Notification events based on their source and achieve the control you're after. That's the best I can do without digging into the problem and the dbus spec. I hope this helps, what you're after should be easier to configure to begin with.