Possible to create settings defaults that overrules the kodi master settings.xml?
#1
So it appears that default settings for Kodi live at: https://github.com/xbmc/xbmc/blob/master...ttings.xml

(I know some others are in guisettings.xml)

Is it possible to create a file, e.g. in userdata, that overrules some of these, that I could then add to my various Kodi installs as a way of quickly configuring them how I like them?  Or add values to those to e.g. advancedsettings.xml?

Kodi is amazing and has loads and loads of configuration as we all know, but over the 15 years I have been using it, I've spent way too much time re-configuring the same things on new/clean installs.  I'd really like to simplify my life and make an xml file with (what I personally consider to be...) much more sane default settings.

Bascially, is there more programmatic way to handle Kodi config??

Actually - I have just seen this: https://kodi.wiki/view/Advancedsettings....Conversion

...am I reading that right - I can put basically any setting in there, and it will be effectively set in code, rather than the UI?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#2
(2023-01-24, 09:45)bossanova808 Wrote: am I reading that right - I can put basically any setting in there, and it will be effectively set in code, rather than the UI?
As far as I am aware, yes.
I need to update that section because apparently you can just copy and paste the setting as is ... <setting id="videolibrary.showemptytvshows">true</setting>
You don't actually need to convert it as shown in that section. I haven't tested but if you can let me know if it works that way, I can update the page.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki) || Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
you can override guisettings.xml from advancedsettings.xml when doing so also hides that setting from the gui, i dont remember the wiki i read but im using this method
i wrote 5m console script to do it but you can see a template here: https://paste.kodi.tv/onocihadaj.kodi

heres the 5m script i used, call as ./guisettings.py guisettings.xml it reads the first argument as the file, does not do everything for you so youll have to go back and format further manuallly

#!/usr/bin/python3

import sys
import xml.etree.ElementTree as ET

if len(sys.argv) >= 1:
    s = open(sys.argv[1]).read()
    
    e = ET.ElementTree(ET.fromstring(s))
    parent=""
    for elem in e.iter():
        if elem.tag=="setting":
            attr=elem.attrib['id'].split(".")
            if parent!=attr[0]:
                if parent!='':
                    print("</{}>".format(parent))
                parent=attr[0]
                print("<{}>".format(parent))
            print("<{}>{}</{}>".format(attr[1],elem.text,attr[1]))
    print("</{}>".format(parent))
    exit()

its not even python3, as stated it was a 5m
just changed usr/bin/python to python3 it works fine with 3 i just didnt write it that way at first
Reply
#4
Thanks - I'll have a play and see what works & report back!
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#5
(@jepsizofye  Given the info from @Karellen above, your script actually just makes things harder by stripping off the parent, but thanks for trying to help in any case.)

Karellen is saying you can literally just copy the setting as is from guisettings.xml into your advancedsettings.xml.

As a test, I added an advancedsettings.xml with just:


<advancedsettings version="1">
    <setting id="videoplayer.seeksteps">-30,30</setting>
    <setting id="videoplayer.seekdelay">0</setting>
</advancedsettings>

...and this successfully automatically configured my Kodi for 'old skool' instant skipping in 30 second blocks.

But note, I did seemingly have to remove the default="true" part of the original guisettings.xml lines to get it to work.

Now the question becomes...how far to go with this?!  One could potentially move just about all the config into code with this...hmmm, very powerful, but at times it is useful to tweak things via the GUI.  hmmm.....
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#6
Yes I have been doing it for a while based on this thread https://forum.kodi.tv/showthread.php?tid=357970  I like sorting PVR by episode number now.

Martin
Reply
#7
Ah, I did not find that in my searching.  But same conclusion - copy the line, remove the default value, and it appears to work.   @Karellen perhaps test to confirm, but I'd say go ahead and update the Wiki with this easier approach.
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#8
right on @bossanova808 

thats not how i understood it when i read whatever i read but as long as it works

this is how i read your example *should* work, i guess both do

<advancedsettings version="1">
<videoplayer>
<seeksteps>-30,30</seeksteps>
<seekdelay>0</seekdelay>
</videoplayer>
</advancedsettings>

glad you got it
Reply
#9
(2023-01-25, 03:37)bossanova808 Wrote: perhaps test to confirm, but I'd say go ahead and update the Wiki with this easier approach.
Great!! Thanks for that. I'll update the page with the easier method in the next day or two.

(2023-01-25, 03:16)bossanova808 Wrote: One could potentially move just about all the config into code with this
Yes, and you can end up with empty settings pages...

Image
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki) || Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply



Logout Mark Read Team Forum Stats Members Help
Possible to create settings defaults that overrules the kodi master settings.xml?0
This forum uses Lukasz Tkacz MyBB addons.