[xubuntu-users] Problems with sending Notifications from Python

Christoph Robbert chrobbert at gmail.com
Thu Oct 2 10:37:21 UTC 2014


Hey,
I want to write a small python script which uses the xfce4-notifyd 
service. It sends a notification at the beginning and after some time 
(in my case 25 Minutes) a second one. Unfortunately I get the following 
error message when sending the second notification.

gi._glib.GError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: 
The name :1.118 was not provided by any .service files


To test this, I wrote a small test script:

from gi.repository import Notify
import time
import datetime

def send_notification(header, text):
     """
         sends a notification and return the object for later use 
(updates etc)
     """
     Notify.init("Hello world")
     n=Notify.Notification.new(header,text,"dialog-information")
     n.show()
     print datetime.datetime.now().isoformat(), header, text
     return n


send_notification("test", "first")
time.sleep(25*60)
send_notification("test", "second")


When changing the time.sleep call to time.sleep(10*60) the second 
message get displayed as expected. I read the Desktop Notifications 
Specification but did not find a timeout or something like that. My used 
xfce4-notifyd version is 0.2.4-2 and I use Ubuntu 14.04 as Operating System.
So is this a bug in xfce4-notifyd or did I do something wrong?

Regards,
Christoph Robbert




More information about the xubuntu-users mailing list