Monday, April 29, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2343  / 3 Years ago, sun, september 26, 2021, 3:12:26

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.


More From » application-development

 Answers
4

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.


[#36065] Monday, September 27, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nquirewha

Total Points: 256
Total Questions: 109
Total Answers: 122

Location: Namibia
Member since Mon, Feb 21, 2022
2 Years ago
;