3

I'm trying to integrate my app with Ubuntu notification system. It works ok, but I don't know how to show my icon in the bubble. My code looks something like:

notification = Notify.Notification.new ("Title", "Some text here", "/data/media/my-app-icon.svg")
notification.show ()

Unfortunately only text is visible.

2
  • Double-check the icon filename and make sure its permissions are set so it's readable by your app. Notification.new won't throw any errors if it can't load the icon. Also, any more code you could show us would help.
    – Isaiah
    Aug 19, 2012 at 22:22
  • I noticed that icon works if I specify path like this: notification = Notify.Notification.new ("Title", "Some text here", "/home/michal/Development/easy-stopwatch/data/media/my-app-icon.svg") notification.show () But this will not work on any other computer.
    – mivoligo
    Aug 20, 2012 at 13:17

2 Answers 2

2

Finally I figured it out. My icon is in /data/media, so I used get_media_file from helpers.py

from easy_stopwatch_lib.helpers import get_media_file

and then I did:

        Notify.init ("easy-stopwatch")
        icon = get_media_file("my-icon.svg")
        notification = Notify.Notification.new ("Title", "some text here", icon)
        notification.show ()

and everything is working.

1

I don't know the code directly, but there is this app called Hello Unity that you can install that teaches you how to integrate with Unity, including Notification. You can install it from the .deb. The link is below.

Link

Hope this helps!

1
  • Thanks for the link. I've looked at their code. Unfortunately I'm not able to understand how they made it working.
    – mivoligo
    Aug 20, 2012 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .