I am currently creating a personal, Zoyinc, fork of the Amber Kodi skin. This is customized to my personal needs.
The reason for the skin is so that if I want to setup additional devices, or rebuild an existing one, I have a simple process.
One of the things that I was trying to achieve was to set some defaults in the skin itself, specifically I wanted to set was “Disable all home shelves”:
Steps
Skins can be created quite differently, so remember these notes are specifically for the Amber skin.
In the plugin look for the file “\1080i\SkinSettings.xml” – this describes the skin settings pages.
You will find a section that looks like:
<include content="YesNoSettingItem">
<param name="itemid" value="12"/>
<param name="itemlabel" value="$LOCALIZE[31920]"/>
<param name="skinsetting" value="Hide.AllShelves"/>
</include>
If you look up “31920” in the localization files, under “/language”, for example “/language/resource.language.en_nz/strings.po” for New Zealand, you will find:
msgctxt "#31920"
msgid "Disable all Home shelves"
msgstr ""
So that means the section in SkinSettings.xml are the ones for the setting “Disable all home shelves”
To see what happens when this setting is changed in the UI you need to look at the code behind the include tag: “<include content=”YesNoSettingItem”>”.
Essentially, if you set this to “Yes” in the UI it will save it in a skin file similar to “\Kodi\userdata\addon_data\kodi.skin.zoyinc\settings.xml” where you will see the property:
<setting id="hide.allshelves" type="bool">true</setting>
The above file is in the user’s settings folder so we can’t do that directly from the skin – we need to find out how to set it in the skin.
Open up “\1080i\Startup.xml” and create an entry that looks like:
<onload condition="!Skin.HasSetting(Hide.AllShelves)">Skin.SetBool(Hide.AllShelves, true)</onload>
As you can imagine this startup.xml file describes tasks that are run when Kodi starts. I think it’s reasonably obvious how this all hangs together and that it is setting Hide.AllShelves to true.