Ubuntu通知はプログラムorg.freedesktopを実行できません。Notifications:そのファイルまたはディレクトリはありません。 (23)

Ubuntu通知はプログラムorg.freedesktopを実行できません。Notifications:そのファイルまたはディレクトリはありません。 (23)

私は通知を表示するPythonスクリプトを書いています。これが私が使っているライブラリです。https://www.devdungeon.com/content/desktop-notifications-linux-python

from gi.repository import Notify
Notify.init("App Name")
Notify.Notification.new("Hi").show()

sudoなしで実行するとうまくいきますが、sudoで実行するとエラーが発生します。

GLib.Error: g-dbus-error-quark: Error calling StartServiceByName for org.freedesktop.Notifications: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.freedesktop.Notifications: No such file or directory (23)

私はgnomeでUbuntu 18を使用しています。誰でも助けることができますか?

ベストアンサー1

修正済み、/usr/share/dbus-1/services/org.freedesktop.Notifications.service ファイル追加

[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon/notification-daemon

内部に

おすすめ記事