NetworkManager Applet 無回應,我在 ~/.xsession-errors 中看到「org.freedesktop.Notifications:已達到逾時」錯誤

NetworkManager Applet 無回應,我在 ~/.xsession-errors 中看到「org.freedesktop.Notifications:已達到逾時」錯誤

我在 ~/.xsession-errors 中看到以下錯誤

(nm-applet:1122): nm-applet-WARNING **: 11:12:56.101: Failed to show notification: Error calling StartServiceByName for org.freedesktop.Notifications: Timeout was reached
[1342:1937:0821/111259.646185:ERROR:object_proxy.cc(619)] Failed to call method: org.freedesktop.Notifications.GetCapabilities: object_path= /org/freedesktop/Notifications: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

我正在使用 i3,狀態列中帶有 xfce 幫助程序,以使某些事情變得更簡單。

我知道如果我啟動 xfce4-notifyd 它會解決問題並修復 xsession-errors 中的錯誤。

systemctl --user start xfce4-notifyd

systemctl --user status xfce4-notifyd
● xfce4-notifyd.service - XFCE notifications service
   Loaded: loaded (/usr/lib/systemd/user/xfce4-notifyd.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2019-08-21 12:52:28 SAST; 10s ago
 Main PID: 10783 (xfce4-notifyd)
   CGroup: /user.slice/user-1000.slice/[email protected]/xfce4-notifyd.service
           └─10783 /usr/lib/xfce4/notifyd/xfce4-notifyd

Aug 21 12:52:28 aaron-pc systemd[1088]: Starting XFCE notifications service...
Aug 21 12:52:28 aaron-pc systemd[1088]: Started XFCE notifications service.

如何讓 xfce4-notifyd 在啟動或登入時啟動。

答案1

經過大量閱讀後,我發現以下來源幫助我解決了這個簡單的解決方案

sudo vim /usr/share/dbus-1/system-services/org.freedesktop.Notification.service

[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd

您可能需要查看 dbus 中配置了哪些其他通知服務。

ls /usr/share/dbus-1/services/ | grep -i noti
org.kde.plasma.Notifications.service
org.xfce.xfce4-notifyd.Notifications.service

如果您已經配置了其他一些通知服務,這可能會導致它們都出現問題,請嘗試啟動。

sudo rm /usr/share/dbus-1/services/org.kde.plasma.Notifications.service

就我而言,使用 Manjaro,這是一種 arch 風格。我的設定有點不同。

可執行檔的路徑位於不同的位置。

pacman -Ql xfce4-notifyd | grep 'xfce4-notifyd$'
xfce4-notifyd /usr/lib/xfce4/notifyd/xfce4-notifyd

我的執行行看起來像這樣

Exec=/usr/lib/xfce4/notifyd/xfce4-notifyd

另外,xfce4-notifyd需要啟動該服務

systemctl --user status xfce4-notifyd
● xfce4-notifyd.service - XFCE notifications service
Loaded: loaded (/usr/lib/systemd/user/xfce4-notifyd.service; static; vendor preset: enabled)
Active: inactive (dead)

systemctl --user start xfce4-notifyd

systemctl --user status xfce4-notifyd
● xfce4-notifyd.service - XFCE notifications service
Loaded: loaded (/usr/lib/systemd/user/xfce4-notifyd.service; static; vendor preset: enabled)
Active: active (running) since Tue 2020-03-10 08:34:10 SAST; 5s ago
Main PID: 7991 (xfce4-notifyd)
CGroup: /user.slice/user-1000.slice/[email protected]/xfce4-notifyd.service
        └─7991 /usr/lib/xfce4/notifyd/xfce4-notifyd

Mar 10 08:34:10 aaron-pc systemd[1456]: Starting XFCE notifications service...
Mar 10 08:34:10 aaron-pc systemd[1456]: Started XFCE notifications service.

以確保在啟動時發生這種情況。我添加以下內容

cd ~/.config/systemd/user/
ln -s /usr/lib/systemd/user/xfce4-notifyd.service 

相關內容