WORKING! 7 different widgets on one Menu Item with XONFLUENCE skin
#1
hi guys

Does anyone know if it possible or a way to change a widgets source/string (what it displays) via a RunScript or ExecuteBuiltin command using the Xonfluence skin. Or by any other method?

Im trying to make it so that when i click on individual add-on shortcuts on the homescreen the widget will change to display a specified source/folder.

I was thinking of a RunScript or ExecuteBuiltin command as i can do this via a Manual Entry within Super Favourites, and then set that as the add-on shortcut.

Within Kodi in the Xonfluence skin the custom widget source/string is displayed and edited in the settings.

In my external Kodi files (kodi/userdata/addon_data/skin.xonfluence/settings.xml) my widget source/string is defined as:

<setting id="HomeItem.8.Widget" type="string">XXXX</setting>

with XXXX being my source/string (mine being plugin://plugin.program.super.favourites/...).

I've had a read and from what i can understand I could edit this file with a Python script, that would be activated by a Super Favourite RunScript command, but I've tried manually editing it with Kodi running and it doesn't change/work, not sure why Confused so don't think thats an option.

Thanks for reading and any help or advice would be much appreciated Smile
Reply
#2
Kodi loads the skin at startup so if you edit a string like that, you would need to reload the skin to see the changes. If however you use a window property that you can display with $INFO[Window(home).Property(myproperty)] then that will update with every render pass.

You can easily create and set window properties with a python script.
Learning Linux the hard way !!
Reply
#3

hi mate, thanks for your reply, really appreciated.

Quote:Kodi loads the skin at startup so if you edit a string like that, you would need to reload the skin to see the changes.

Just been having a play around with it then:
  • With Kodi running, I manually edited the settings.xml and ran ReloadSkin() command via ExecuteBuiltIn and it blinks/flashes as if its doing something but still shows previous widget

  • With Kodi closed, if I edit the settings.xml and then re-open Kodi it shows my new widget Confused

Not sure if the ReloadSkin() is not working or whether the skin is caching/saving elsewhere after it loads, and is then reading from there rather than from the settings.xml file Confused

Quote:If however you use a window property that you can display with $INFO[Window(home).Property(myproperty)] then that will update with every render pass.

You can easily create and set window properties with a python script.

I've not come across that before Huh (quite new to the workings of kodi and scripting/python in general!) will have a read up on it now. Is it similar to an ActivateWindow or is it still via a widget?

thanks again

danny
Reply
#4
A window property is something that you can define in a python script running inside of Kodi. Lots of scripts use this to send info to skins that they wouldn't otherwise be able to display. There are also a bunch of pre-defined window properties. http://kodi.wiki/view/InfoLabels (see section 17 in particular).

So, in a python script you can do this
PHP Code:
window xbmcgui.Window(10000# thats the Home window
window.setProperty("myproperty","My Value"

Then in your skin you do
PHP Code:
<control type="label">    
<
label>$INFO[Window(Home).Property(myproperty)]</label>
</
control

That would display My Value

When the script updates myproperty, then that will be reflected on screen.

This isn't the easiest thing to get your head around to start with as it involves some skinning knowledge as well as python but it's extremely powerful and flexible as it allows you to display and change exactly what you want. Scripts can be started and stopped when a window opens (with onload and onunload tags in the skin) or can be made to run when Kodi starts. All this stuff is in the wiki but it does take a bit of digging around to link it all up !! Undecided
Learning Linux the hard way !!
Reply
#5
(2016-09-11, 22:38)black_eagle Wrote: A window property is something that you can define in a python script running inside of Kodi. Lots of scripts use this to send info to skins that they wouldn't otherwise be able to display. There are also a bunch of pre-defined window properties. http://kodi.wiki/view/InfoLabels (see section 17 in particular).

So, in a python script you can do this
PHP Code:
window xbmcgui.Window(10000# thats the Home window
window.setProperty("myproperty","My Value"

Then in your skin you do
PHP Code:
<control type="label">    
<
label>$INFO[Window(Home).Property(myproperty)]</label>
</
control

That would display My Value

When the script updates myproperty, then that will be reflected on screen.

This isn't the easiest thing to get your head around to start with as it involves some skinning knowledge as well as python but it's extremely powerful and flexible as it allows you to display and change exactly what you want. Scripts can be started and stopped when a window opens (with onload and onunload tags in the skin) or can be made to run when Kodi starts. All this stuff is in the wiki but it does take a bit of digging around to link it all up !! Undecided

hi mate, thanks for getting back to me

couldn't get it working via the Window Property, not for the love of trying either Confused still don't know what I'm doing wrong!

Had a good read through the wiki page just got really confused! I find the wiki is quite hit n miss a lot of the time, i think it requires a certain level of knowledge/understanding - that i don't have! Haha

But when i was looking through the Xonfluence source code for the $INFO[Window(Home) functions i came across the Skin.SetString commands that got it working in the end Smile have posted it below.

thanks again for your help mate

danny
Reply
#6
WORKING!!!!


Below is how i got Add-On shortcuts on my home menu to each have there own different widgets, meaning you can get upto 7 widgets on one HomeMenu within Xonfluence.

It does require writing individual scripts.py for each widget, and there is probably a much better and easier way to do this, but having searched the forums and google (a lot) I couldn't find one, and it's nice and easy, so thought id share it... Smile

I made a python script (SCRIPT1.py) with text editor/notepad, containing the code below and saved it in the Super Favourites Userdata folder located at /userdata/addon_data/plugin.program.super.favourites/

PHP Code:
import xbmc

cmd 
'Skin.SetString(HomeItem.1.Widget, XXXX)'
xbmc.executebuiltin(cmd)

cmd 'ClearProperty(HomeItem.1, Home)'
xbmc.executebuiltin(cmd

XXXX being the source/string to display. In my case a Super Favourite folder so plugin.program.super.favourites/...

I then used Manual Entry in Super Favourites to make a RunScript to run the command below:

Code:
Special://home/userdata/addon_data/plugin.program.super.favourites/SCRIPT1.py

added a thumbnail to the created Super Favourite, and added it to my Kodi favourites, and added that Kodi favourite to my Add-Ons shortcuts menu in settings.

Now when i click on my customised Super Favourite Add-On's along the bottom on my home screen, they each show different widgets Smile

With the 12 individual Add-On sets available in Xonfluence thats up to 84 widgets! Rofl
Reply
#7
(2016-09-12, 03:41)dannyrobbo Wrote: With the 12 individual Add-On sets available in Xonfluence thats up to 84 widgets! Rofl

...but would mean 84 individual scripts Confused

If anyone knows how i could make it easier/faster it would be really appreciated Smile

thanks for reading
Reply
#8
I would think the easiest way would be to change the main menu to use skin shortcuts.

Then build the widgets using templates. It does take a lot to get you head around how to go about it but skin shortcuts is well documented.

If you take a look at the code for Madnox and Nox Silvo it should give you some ideas. It did take me a number of months for me to understand and develop the widgets for both these skins. It is rather complicated code but could be simplified for less features.

The other method would be look take a look at how estuary is coded. 5 widgets per menu item that is a simple and clever solution.
Madnox 2.0
Forum / Source
Reply
#9
(2016-09-12, 03:44)dannyrobbo Wrote:
(2016-09-12, 03:41)dannyrobbo Wrote: With the 12 individual Add-On sets available in Xonfluence thats up to 84 widgets! Rofl

...but would mean 84 individual scripts Confused

If anyone knows how i could make it easier/faster it would be really appreciated Smile

thanks for reading 
Hi Dannyrobbo,

I'm trying to recreate what you did here...but it hasn't worked for me.  Whenever I click on the addon shortcut on the home page, it takes me to an empty list, even though the SF folder the python script points to has favourites in it.

I'm using SuperFavourites 1.0.59 and Xonfluence 9.99.99 from the 'Helly' repo.

Can you help me figure out what I've done wrong?
Reply
#10
(2016-09-12, 03:44)dannyrobbo Wrote:
(2016-09-12, 03:41)dannyrobbo Wrote: With the 12 individual Add-On sets available in Xonfluence thats up to 84 widgets! Rofl

...but would mean 84 individual scripts Confused

If anyone knows how i could make it easier/faster it would be really appreciated Smile

thanks for reading  
 Hi Dannyrobbo,

I'm trying to recreate what you did here...but it hasn't worked for me.  Whenever I click on the addon shortcut on the home page, it takes me to an empty list, even though the SF folder the python script points to has favourites in it.

I'm using SuperFavourites 1.0.59 and Xonfluence 9.99.99 from the 'Helly' repo.

Can you help me figure out what I've done wrong?
Reply

Logout Mark Read Team Forum Stats Members Help
WORKING! 7 different widgets on one Menu Item with XONFLUENCE skin0