Sim, mas com ressalvas ... killall notify-osd é agressivo ... para fazer isso normalmente, é necessário que as notificações pendentes sejam salvas antes que a ofensiva acione killall notify-osd e, em seguida, restabeleça-as preservando a integridade cronológica.
ref:
Botão Fechar no notify-osd?
seria bom se: Can org.freedesktop.Notifications .CloseNotification (uint id) pode ser acionado e invocado via DBus?
Monitore D-Bus para localizar notificações de remoção originadas do aplicativo escolhido. Execute esse script em um terminal ou como uma tarefa em segundo plano, alterando ap_name_to_silence para o nome do ap escolhido para limitação:
dbus-monitor "interface='org.freedesktop.Notifications'" \ | grep --line-buffered 'string "ap_name_to_silence"' \ | sed -u -e 's/.*/killall notify-osd/g' \ | bash
Básico Notify estrutura em dbus-monitor "interface='org.freedesktop.Notifications'" é
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
teste o silenciador com estas mensagens indicando que "silenced notification" está ausente:
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:
É possível bloquear o NotifyOSD para um aplicativo?