Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Alvin Row Aug 19 '12 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 '12 at 13:17
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
add comment

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!

share|improve this answer
    
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 '12 at 13:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.