当客户端连接到我的 vino 服务器 VNC 时抑制通知

当客户端连接到我的 vino 服务器 VNC 时抑制通知

编辑

如果我通过 ssh 连接,启动dbus-monitor,然后连接 TigerVNC,我就会看到以下内容。

$ dbus-monitor "interface='org.freedesktop.Notifications'"
signal time=1650458466.197413 sender=org.freedesktop.DBus -> destination=:1.236 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.236"
signal time=1650458466.197460 sender=org.freedesktop.DBus -> destination=:1.236 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.236"
method call time=1650458500.661102 sender=:1.98 -> destination=:1.69 serial=119 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=CloseNotification
   uint32 9
method call time=1650458500.662477 sender=:1.69 -> destination=:1.49 serial=109 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=CloseNotification
   uint32 9
signal time=1650458500.664097 sender=:1.49 -> destination=(null destination) serial=10204 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=NotificationClosed
   uint32 9
   uint32 3
signal time=1650458500.665577 sender=:1.69 -> destination=(null destination) serial=110 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=NotificationClosed
   uint32 9
   uint32 3
method call time=1650458500.673202 sender=:1.98 -> destination=:1.69 serial=120 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "GNOME Desktop Sharing"
   uint32 0
   string "preferences-desktop-remote-desktop"
   string "Another user is controlling your desktop"
   string "A user on the computer 'xxxxxxxxxx' is remotely controlling your desktop."
   array [
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "vino-server"
      )
   ]
   int32 5000
method call time=1650458500.678437 sender=:1.69 -> destination=:1.49 serial=113 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "GNOME Desktop Sharing"
   uint32 0
   string "preferences-desktop-remote-desktop"
   string "Another user is controlling your desktop"
   string "A user on the computer 'xxxxxxxxxx' is remotely controlling your desktop."
   array [
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "vino-server"
      )
      dict entry(
         string "sender-pid"
         variant             uint32 13810
      )
   ]
   int32 5000

有关的

  1. 是否可以阻止一个应用程序的 NotifyOSD?
  2. org.freedesktop.Notifications.CloseNotification(uint id) 可以通过 DBus 触发和调用吗?
  3. 我如何暂时过滤掉来自特定来源的某些通知气泡?
  4. https://askubuntu.com/a/194279/226614

我在 Ubuntu 20.04.3 LTS 中使用vino-server。当客户端连接到我的电脑时,我会收到通知。我想禁用它们。客户端是 Win 10 中的 TigerVNC,但我想这无关紧要。

我已设置org.gnome.Vino notify-on-connectfalse。由于从命令行设置此项似乎不会改变我在 中看到的内容dconf-editor(至少立即不会,我没有进一步修改它),所以我也在 中设置了它dconf-editor,然后重新启动。

我有这个。但我不知道还能在哪里找到。

$ gsettings list-recursively org.gnome.Vino
org.gnome.Vino prompt-enabled false
org.gnome.Vino require-encryption false
org.gnome.Vino use-alternative-port false
org.gnome.Vino disable-background false
org.gnome.Vino disable-xdamage false
org.gnome.Vino alternative-port uint16 5900
org.gnome.Vino icon-visibility 'client'
org.gnome.Vino authentication-methods ['vnc']
org.gnome.Vino network-interface ''
org.gnome.Vino notify-on-connect false
org.gnome.Vino mailto ''
org.gnome.Vino lock-screen-on-disconnect false
org.gnome.Vino use-upnp false
org.gnome.Vino vnc-password 'keyring'
org.gnome.Vino view-only false

我如何禁用这些通知?
似乎不太可能在 vino 级别执行此操作(即使显然有此设置!)。也许通知处理有某种类型的过滤。

$ dpkg -l | grep notif
ii  gir1.2-notify-0.7:amd64            0.7.9-1ubuntu2         amd64    sends desktop notifications to a notification daemon (Introspection files)
ii  libevent-2.1-7:amd64               2.1.11-stable-1        amd64    Asynchronous event notification library
ii  libkf5notifications-data           5.68.0-0ubuntu1        all      Framework for desktop notifications
ii  libkf5notifications5:amd64         5.68.0-0ubuntu1        amd64    Framework for desktop notifications
ii  libnotify-bin                      0.7.9-1ubuntu2         amd64    sends desktop notifications to a notification daemon (Utilities)
ii  libnotify4:amd64                   0.7.9-1ubuntu2         amd64    sends desktop notifications to a notification daemon
ii  libstartup-notification0:amd64     0.12-6                 amd64    library for program launch feedback (shared library)
ii  libuv1:amd64                       1.34.2-1ubuntu1.3      amd64    asynchronous event notification library - runtime library
ii  update-notifier                    3.192.30.10            amd64    Daemon which notifies about package updates
ii  update-notifier-common             3.192.30.10            all      Files shared between update-notifier and other packages
ii  vlc-plugin-notify:amd64            3.0.9.2-1              amd64    LibNotify plugin for VLC

可以做的是全局禁用通知请勿打扰,并且它对我的情况很有效,但这适用于任何通知。

在此处输入图片描述

相关内容