{"id":6378,"date":"2025-01-18T15:25:53","date_gmt":"2025-01-18T02:25:53","guid":{"rendered":"https:\/\/www.zoyinc.com\/?p=6378"},"modified":"2025-01-27T11:52:32","modified_gmt":"2025-01-26T22:52:32","slug":"set-default-settings-values-in-kodi-skins","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=6378","title":{"rendered":"Set default settings values in Kodi skins"},"content":{"rendered":"\n<p>I am currently creating a personal, Zoyinc, fork of the Amber Kodi skin. This is customized to my personal needs.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>One of the things that I was trying to achieve was to set some defaults <strong>in the skin itself<\/strong>, specifically I wanted to set was &#8220;Disable all home shelves&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1883\" height=\"563\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2025\/01\/image-21.png\" alt=\"\" class=\"wp-image-6379\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2025\/01\/image-21.png 1883w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2025\/01\/image-21-300x90.png 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2025\/01\/image-21-250x75.png 250w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2025\/01\/image-21-768x230.png 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2025\/01\/image-21-1536x459.png 1536w\" sizes=\"auto, (max-width: 1883px) 100vw, 1883px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Steps<\/h1>\n\n\n\n<p>Skins can be created quite differently, so remember these notes are specifically for the Amber skin.<\/p>\n\n\n\n<p>In the plugin look for the file &#8220;\\1080i\\SkinSettings.xml&#8221; &#8211; this describes the skin settings pages.<\/p>\n\n\n\n<p>You will find a section that looks like:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:0.9rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(1 * 0.6 * 0.9rem);line-height:1.4rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"&lt;include content=&quot;YesNoSettingItem&quot;&gt;\n  &lt;param name=&quot;itemid&quot; value=&quot;12&quot;\/&gt;\n  &lt;param name=&quot;itemlabel&quot; value=&quot;$LOCALIZE[31920]&quot;\/&gt;\n  &lt;param name=&quot;skinsetting&quot; value=&quot;Hide.AllShelves&quot;\/&gt;\n&lt;\/include&gt;\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #800000\">&lt;include<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">content<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;YesNoSettingItem&quot;<\/span><span style=\"color: #800000\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #800000\">&lt;param<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">name<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;itemid&quot;<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">value<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;12&quot;<\/span><span style=\"color: #800000\">\/&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #800000\">&lt;param<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">name<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;itemlabel&quot;<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">value<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;$LOCALIZE[31920]&quot;<\/span><span style=\"color: #800000\">\/&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #800000\">&lt;param<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">name<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;skinsetting&quot;<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">value<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;Hide.AllShelves&quot;<\/span><span style=\"color: #800000\">\/&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #800000\">&lt;\/include&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>If you look up &#8220;31920&#8221; in the localization files, under &#8220;\/language&#8221;, for example &#8220;\/language\/resource.language.en_nz\/strings.po&#8221; for New Zealand, you will find:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:0.9rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(1 * 0.6 * 0.9rem);line-height:1.4rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"msgctxt &quot;#31920&quot;\nmsgid &quot;Disable all Home shelves&quot;\nmsgstr &quot;&quot;\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #000000\">msgctxt &quot;#31920&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">msgid &quot;Disable all Home shelves&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">msgstr &quot;&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>So that means the section in SkinSettings.xml are the ones for the setting &#8220;Disable all home shelves&#8221;<\/p>\n\n\n\n<p>To see what happens when this setting is changed in the UI you need to look at the code behind the include tag:  &#8220;&lt;include content=&#8221;YesNoSettingItem&#8221;&gt;&#8221;.<\/p>\n\n\n\n<p>Essentially, if you set this to &#8220;Yes&#8221; in the UI it will save it in a skin file similar to &#8220;\\Kodi\\userdata\\addon_data\\kodi.skin.zoyinc\\settings.xml&#8221; where you will see the property:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:0.9rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(1 * 0.6 * 0.9rem);line-height:1.4rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"&lt;setting id=&quot;hide.allshelves&quot; type=&quot;bool&quot;&gt;true&lt;\/setting&gt;\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #800000\">&lt;setting<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">id<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;hide.allshelves&quot;<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">type<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;bool&quot;<\/span><span style=\"color: #800000\">&gt;<\/span><span style=\"color: #000000\">true<\/span><span style=\"color: #800000\">&lt;\/setting&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The above file is in the user&#8217;s settings folder so we can&#8217;t do that directly from the skin &#8211; we need to find out how to set it in the skin.<\/p>\n\n\n\n<p>Open up &#8220;\\1080i\\Startup.xml&#8221; and create an entry that looks like:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:0.9rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(1 * 0.6 * 0.9rem);line-height:1.4rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"&lt;onload condition=&quot;!Skin.HasSetting(Hide.AllShelves)&quot;&gt;Skin.SetBool(Hide.AllShelves, true)&lt;\/onload&gt;\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #800000\">&lt;onload<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #E50000\">condition<\/span><span style=\"color: #000000\">=<\/span><span style=\"color: #0000FF\">&quot;!Skin.HasSetting(Hide.AllShelves)&quot;<\/span><span style=\"color: #800000\">&gt;<\/span><span style=\"color: #000000\">Skin.SetBool(Hide.AllShelves, true)<\/span><span style=\"color: #800000\">&lt;\/onload&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>As you can imagine this startup.xml file describes tasks that are run when Kodi starts. I think it&#8217;s reasonably obvious how this all hangs together and that it is setting Hide.AllShelves to true.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":6380,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[735],"tags":[],"class_list":["post-6378","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kodi-technology"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/6378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6378"}],"version-history":[{"count":3,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/6378\/revisions"}],"predecessor-version":[{"id":6438,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/6378\/revisions\/6438"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/6380"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6378"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}