icon in Notification command
#1
Hi there,

Im using this tutorial for a simple notification box: http://kodi.wiki/view/GUI_tutorial

I was wondering what the path to the icon.png should be.

I have my plugin called plugin.program.xxx but if I add it to the text below it does not work:

xbmc.executebuiltin('Notification(Hello World,This is a simple example of notifications,5000,/script.hellow.world.png)') ORIGINAL TEXT IN THE WIKI

xbmc.executebuiltin('Notification(KODI WILL NOW REBOOT,Your settings have not changed,5000,/plugin.program.xxx/icon.png)') MODIFIED TEXT

Hoping someone can help.
Reply
#2
You need to get the path to the addon directory, then add your image path to the end.

Code:
addon= xbmcaddon.Addon()
path = addon.getAddonInfo('path').decode("utf-8") + "/your_image.png"

xbmc.executebuiltin('Notification(KODI WILL NOW REBOOT, Your settings have not changed, 5000, %s)' % (path))
Reply
#3
I recommend to use xbmcgui.Dialog().notification(): http://romanvm.github.io/Kodistubs/_auto...tification
A custom icon needs to be provided as a full path to a texture image (jpg or png).
Reply
#4
Further to my first post Ive got an issue with a notification box im trying to create.
Id like to add the kodi version to the end.
Here is my code but its not working.

#kodiv  = float(xbmc.getInfoLabel("System.BuildVersion")[:4])
kodiv  = xbmc.getInfoLabel(System.BuildVersion)
dialog = xbmcgui.Dialog()            
                        

dialog.notification(('[COLOR lime] STARTING UP[/COLOR]', 'Welcome to Kodi',+str(kodiv), xbmcgui.NOTIFICATION_INFO, 10000))
Reply
#5
If that is Python, and kodiv has the version number in it, then you need to remove the comma before the plus:

Code:

dialog.notification(('[COLOR lime] STARTING UP[/COLOR]', 'Welcome to Kodi'+str(kodiv), xbmcgui.NOTIFICATION_INFO, 10000))
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | Caber Toss | Switchback | XSqueezeDisplay | Kodi 2nd Display
Sorry, no help w/out a *full debug log*.
Reply

Logout Mark Read Team Forum Stats Members Help
icon in Notification command0