Flatpak: Where are user created Color Schemes stored?

I made my own colorscheme based off the default Dark one.

I want to export it but can’t find it anywhere.

With the flatpak, all user created files are in ~/.var/app/org.libreoffice.LibreOffice/config/libreoffice/4/user

But I searched, and didn’t find a thing.

A file in ~/.var/app/org.libreoffice.LibreOffice/config/libreoffice/4/user/registrymodifications.xcu references the theme to be in /org.openoffice.Office.UI/ColorScheme/ColorSchemes but that directory does not even exist.

...
<item oor:path="/org.openoffice.Office.UI/ColorScheme/ColorSchemes"><node oor:name="Augenfreundlich" oor:op="replace"><node oor:name="Links"><prop oor:name="Dark"
...

Is the colorscheme coded into that config file?


Some research suggests that is the case. I installed themes from the extensions tool though, so I it must be possible to export them.

https://wiki.documentfoundation.org/Videos/Create_color_palette/en

This is a bit confusing, seems to be unrelated.

there is this repo, was all this done manually???

Colour palette is different, that is the colour palettes that you see when colouring text, backgrounds, cells, etc.

In my Windows installation, when I look inside registrymodifications.xcu for the modification I made, it is such a long line I think it is the entire description of the theme.
If I open the Office 2003 Blue installed theme under Additions/xxxxx I see a file Theme.xcu which again seems to be the entire description except for a thumbnail in png format.

.
More improvements are in hand or already implemented in the master file I believe so saving your theme separately from the registrymodifications.xcu might be possible in future versions. For the moment I would save a copy of your user folder as a backup.

So I guess I need to go the hacky way and extract my color scheme from that huge XML file.

(using Linux and the flatpak directories)

1. Set name

interactively

read -p "What name should the colorscheme have? " SCHEMENAME

or static

SCHEMENAME=MyTheme

2. Format the file

It looks horrendous, using xmllint it can be made way more readable

cp ~/.var/app/org.libreoffice.LibreOffice/config/libreoffice/4/user/registrymodifications.xcu registrymods-unformatted.xcu

xmllint --format registrymods-unformatted.xcu > registrymods.xcu
rm -f registrymods-unformatted.xcu

3. Extract the colorscheme

awk '/<item oor:path="\/org.openoffice.Office.UI\/ColorScheme\/ColorSchemes">/,/<\/item>/' registrymods.xcu > colorscheme.xcu

4. Metadata XML stuff

Remove unfitting lines

sed -i '/item/d' colorscheme.xcu

Add this to the beginning:

sed -i '1i\
<?xml version="1.0" encoding="UTF-8"?>\
<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">\
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"\
  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
  xmlns:install="http://openoffice.org/2004/installation" oor:name="UI"\
  oor:package="org.openoffice.Office">\
  <node oor:name="ColorScheme">\
    <node oor:name="ColorSchemes">' colorscheme.xcu

And this to the end:

cat >> colorscheme.xcu <<EOF
    <prop oor:name="CurrentColorScheme">
      <value>$SCHEMENAME</value>
    </prop>
  </node>
</oor:component-data>
EOF

Now format the file again to look nice

xmllint --format colorscheme.xcu > Theme.xcu
rm -f colorscheme.xcu