Is it possible to get the value of a kodi system GUI Setting?
#1
I'm trying to make a "convenience" page for myself in my skin that has references to common settings I like to change. I'm able to display the setting names and have links that take me to the actual setting on the appropriate page and all. The problem i'm having trouble with is trying to display the value of the system setting in my convenience page so I can know if i've set them all to my liking at a glance or not.

xml:

<item>
    <!-- Interface.Regional.Language -->
    <label>$LOCALIZE[14206].$LOCALIZE[14222].$LOCALIZE[248]</label>
    <label2>locale.language</label2>
    <onclick>ActivateWindowAndFocus(appearancesettings,-99,0,-79,0)</onclick>
    <property name="description">$LOCALIZE[36114]</property>
</item>

This is the code i'm using, this example is for the Language setting in Interface > Regional. Everything works except `<label2>`. I've tried $INFO[], i've tried Skin.String(), i've tried $INFO[Skin.String()] to no avail Sad.

I discovered this thread, https://forum.kodi.tv/showthread.php?tid=342539, which allows one to do what i'm trying to achieve programmatically via an addon but i'd like to access the gui setting value through the skin directly. Is it possible?
Reply
#2
You can only get booleans - System.GetBool(boolean)
Reply
#3
I know you're looking for a native method but I just added a get_jsonrpc plugin method to SkinVariables v2.0.12 (will be added to my repo tonight).
https://github.com/jurialmunkey/script.s...-container

There was a way to do this already in TMDbHelper but I always felt it was a bit of a bad fit for that plugin, hence moving it over. The approach used in SkinVariables is also a lot more flexible because it can be used for any JSON RPC method

e.g. Get setting for locale.language and output it to Window(Home).Property(KodiSetting.LocaleLanguage.Value)
xml:

<onclick>RunPlugin(plugin://script.skinvariables/?info=get_jsonrpc&amp;method=Settings.GetSettingValue&amp;setting=locale.language&amp;window_prop=KodiSetting.LocaleLanguage&amp;window_id=Home)</onclick>

To use it in a container just add it as content path instead (it will output the value to ListItem.Property(value) of the container listitem).
xml:

<content>plugin://script.skinvariables/?info=get_jsonrpc&amp;method=Settings.GetSettingValue&amp;setting=locale.language</content>

Because it works with any JSON RPC method, you can also use it to set the setting e.g.:
xml:

<onclick>RunPlugin(plugin://script.skinvariables/?info=get_jsonrpc&amp;method=Settings.SetSettingValue&amp;setting=locale.language&amp;value=resource.language.en_au)</onclick>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#4
Thanks jurialmunkey!

Your feedback actually gave me a really good idea for an implementation I can expand on from my DS-Helper script plugin. My DS-Helper script plugin already has a method for me to get individual kodi settings to Window properties. I can modify it to accept multiple settings requests at once and set them all to window properties wrapped inside the page's onload tag, like this:

xml:
<onload>RunScript(script.dstealth.helper, action=getkodisettings, window_id=Home, my_window_property_name1=locale.language, my_window_property_name2=locale.country, prop_something=screensaver.mode)</onload>

This should, in theory, ensure that the page always has the current values for those properties whenever it is loaded. Then I simple get the values like this:

Code:

$INFO[Window(Home).Property(my_window_property_name1)]
$INFO[Window(Home).Property(my_window_property_name2)]
$INFO[Window(Home).Property(prop_something)]
Reply
#5
Just quickly coded it and tested it. Works wonders! Thanks again for the brilliant idea @jurialmunkey !
Reply
#6
Using the Embuary Helper returns the same result: https://github.com/sualfred/script.embua...di-setting
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to get the value of a kodi system GUI Setting?0