TransWikia.com

Ubuntu Notification Failed to execute program org.freedesktop.Notifications: No such file or directory (23)

Unix & Linux Asked by Kryptic Coconut on December 19, 2020

i was working on a python script that displays notification, here’s the library I’m using https://www.devdungeon.com/content/desktop-notifications-linux-python

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

it works fine when I run it without sudo but when I run it with sudo, it gives error

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)

I’m using ubuntu 18 with gnome, can someone help?

One Answer

Fixed, added a file in /usr/share/dbus-1/services/org.freedesktop.Notifications.service with

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

in it

Answered by Kryptic Coconut on December 19, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP