Действительно ли возможно заблокировать NotifyOSD для одного приложения?

Там какой-либо путь состоит в том, чтобы предотвратить NotifyOSD (или XFCE-уведомить) из отображающихся уведомлений из одного конкретного приложения?

1
задан 9 August 2011 в 05:24

1 ответ

Да, но с протестами... killall notify-osd агрессивно..., чтобы сделать, это корректно требует, чтобы незаконченные уведомления были сохранены перед нарушающими триггерами killall notify-osd и затем восстановите их сохраняющий хронологическую целостность.

касательно:
Близкая кнопка на уведомляет-osd?
это было бы хорошо если: Может org.freedesktop. Уведомления. CloseNotification (uint идентификатор) быть инициированным и вызванным через DBus?

Монитор D-Bus найти уведомления для удаления, которые происходят из выбранного приложения. Запустите этот скрипт в терминале или как фоновая задача, изменившись ap_name_to_silence к названию AP, выбранного для регулировки:

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

Основной Notify структура в 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

тестовый глушитель с этими сообщениями замечание "silenced notification" отсутствует:

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

Закладка:
Действительно ли возможно заблокировать NotifyOSD для одного приложения?

2
ответ дан 7 December 2019 в 14:48

Другие вопросы по тегам:

Похожие вопросы: