Ubuntu – Filter messages to “notification area” applet

12.04gnome-classicnotificationnotification-area

I need to change the way the notification area applet (not the indicator applet!) is displaying notifications. I like the old way where notifications were briefly shown on a black popup window; I can only get that behavior if I remove the notification area from the panel. However, if I do so, my pidgin icon disappears also.

On my panel, there are two icons served by the applet: pidgin icon and a mail icon with small black number showing how many notifications are there. I think it is extremely annoying to accumulate notifications such as "user is offline" or "all downloads are completed" because I have to constantly click on "Clear all notifications" button .

Is there a way to filter the notifications or otherwise configure the widget? Is there a source code for it? I couldn't find it, there seems to be no process associated with the applet.

Thank you!

PS: I'm running gnome-classic on 12.04

Best Answer

  • A crude generic solution:

    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 filter out messages.

    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.

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

    For details see:
    How can I temporarily filter-out certain notification-bubbles coming from specific sources?

    cross refs.: