Page 1 of 1

read and import setting

Posted: 10 Jun 2022 13:31
by yusef88
let's say, we have some customized settings stored in external text file like that:

Code: Select all

[Settings] 
key=value
key=value

[FileAssoc]
1=xxxxxx
2=xxxxxx
can we make XY read those keys and import them into current XYplorer.ini in a simple method
without the need to modify each key individually using the command 'setkey'?

Re: read and import setting

Posted: 10 Jun 2022 13:54
by highend
No, how should XY know which settings these are?^^

Re: read and import setting

Posted: 10 Jun 2022 14:52
by yusef88
by making some comparisons: match the section name and its subkey with the equivalent in xyplorer.ini
It's just an idea. and thanks for your reply

Re: read and import setting

Posted: 10 Jun 2022 15:09
by highend
And how do you think "make some comparisons" would work? By looping over them^^

Re: read and import setting

Posted: 10 Jun 2022 15:25
by VeeGee
This would actually be a pretty cool idea. Upon startup, XY could check if the standardized file name exists, e.g. XYCustom.ini, parse it and override any settings. Much simpler than editing the full INI file.

Similar idea to how Vivaldi (browser) handles custom CSS files. You drop them in a folder, tell Vivaldi where to look and then it loads your CSS modifications after it load its' own.

Re: read and import setting

Posted: 13 Jun 2022 09:09
by eil
I'd say this is possible, but can't call it simple way, and result will just copy desired key+values in INI, so one will have to restart XY to get migrated settings working. If the plan was to virtually "add setting" over existing ones, without modifying main INI, then it's not possible for now.

Re: read and import setting

Posted: 13 Jun 2022 09:22
by highend
The whole thing can't be done currently (without being implemented in XY itself) without either:
- An external tool that merges the .ini before XY gets started (which would be easy enough)
- Starting XY twice (one time with a script that imports the settings, starting to tray and another instance afterwards that loads normally). Makes no sense because of pure startup time
Similar idea to how Vivaldi (browser) handles custom CSS files. You drop them in a folder, tell Vivaldi where to look and then it loads your CSS modifications after it load its' own.
Yeah, in the way like patched toolbar icons work, a standard folder in <xydata> and XY reads files (alphabetically) from it to apply their .ini settings. Last match wins...