Is there any way to prevent NotifyOSD (or XFCE-Notify) from displaying notifications from one particular application?
-
I think it depends on the application rather than notification-daemon application like xchat or empathy give you the option of disabling notification. – sagarchalise Aug 09 '11 at 04:39
-
Obviously I'm talking about an app that does not have this option... – Borsook Aug 09 '11 at 09:21
-
which application are you talking about – sagarchalise Aug 09 '11 at 09:29
-
I mean Jupiter, it has some problems with notifications - under XFCE-notify they do not close, under NotifyOSD they get reopened several times before they close. Still it would be nice to prevent any app from spamming those. – Borsook Aug 09 '11 at 12:00
-
seems like the notification is just the script located at `/usr/lib/jupiter/scripts/notify` just edit the script to do nothing – sagarchalise Aug 09 '11 at 12:16
-
sadly my feeble attempts to modify this file resulted in losing the tray icon for Jupiter... – Borsook Aug 10 '11 at 09:23
-
Well, as I went through all the scripts inside `/usr/lib/jupiter/scripts/` I see a flag called No_NOTIFY. May be you should run jupiter with `-silent` argument or May be just change `if [ ! "$NO_NOTIFY" = "1" ];` to `if [ "$NO_NOTIFY" = "1" ];` But may be you have tried that already – sagarchalise Aug 10 '11 at 11:36
-
Thanks a lot! that worked! Stil, a pity we can't "blacklist" an app :) – Borsook Aug 10 '11 at 21:54
-
@sagarchalise Answer this question below so it can be marked as answered please :) – Amith KK Mar 16 '12 at 09:34
-
@Borsook 'blacklisting' an application will not be an easy thing to do. There are thousands of ways so as to display a notification, like doing it directly, using a command that calls `notify-send`, or calling a completely external script. Tracking all these down so as to prevent notifications would be very hard to do. – hytromo Aug 22 '12 at 21:59
1 Answers
Yes but with caveats ... killall notify-osd is aggressive ... to do this gracefully requires that pending notifications be saved before the offending one triggers killall notify-osd and then reinstate them preserving chronological integrity.
ref:
Close button on notify-osd?
it would be nice if: Can org.freedesktop.Notifications.CloseNotification(uint id) be triggered and invoked via DBus?
Monitor D-Bus to find notifications for removal that originate from the chosen application. Run this script in a terminal or as a background task, changing ap_name_to_silence to the name of the ap chosen for throttling:
dbus-monitor "interface='org.freedesktop.Notifications'" \ | grep --line-buffered 'string "ap_name_to_silence"' \ | sed -u -e 's/.*/killall notify-osd/g' \ | bash
Basic Notify structure in dbus-monitor "interface='org.freedesktop.Notifications'" is
method call sender=:1.278 -> dest=:1.151 serial=7 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
string "notify-send" this is the app_name
uint32 0 this is the replaces_id
string "" this is the app_icon
string "test" this is the summary
string "" this is the body
array [ this is the actions pairs list
]
array [ this is the hints dictionary
dict entry(
string "urgency"
variant byte 1
)
]
int32 -1 this is the expire_timeout
test silencer with these messages noting "silenced notification" is absent:
notify-send "sum airy" "ephemeral corporeal content"; sleep 5;
gdbus call --session \
-d org.freedesktop.Notifications \
-o /org/freedesktop/Notifications \
-m org.freedesktop.Notifications.Notify \
ap_name_to_silence \
42 \
gtk-dialog-info \
"The target" \
"silenced notification" \
[] \
{} \
5000
notify-send "augend airy" "ephemeral corporeal content - ie. white moo juice\!"
gdbus call --session \
-d org.freedesktop.Notifications \
-o /org/freedesktop/Notifications \
-m org.freedesktop.Notifications.Notify \
my_app_name \
42 \
gtk-dialog-info \
"Summary" \
"but now it's autumny and not wintery" \
[] \
{} \
5000
Bookmark:
Is it possible to block NotifyOSD for one application?
- 202
- 2
- 4