Where does LibreOffice expect user scripts (Python/Java/JavaScript) to be located on Ubuntu?

LibreOffice on Ubuntu by default creates this location under /home/<username>:

~/.config/libreoffice/4/user/

Since I couldn’t find the answer to the question in my title online, I’ve, based on existing answers for Windows, assumed it is expecting it in:

~/.config/libreoffice/4/user/Script/python/

But *.py files from that location are not displayed under Organize Macros… → Python → My Macros (nor in any other “Directory” on that dialog).

This is all under:

Xubuntu Zesty 17.04
LibreOffice 5.3.1-0ubuntu2

Does anyone know where does LibreOffice on Ubuntu expects the user scripts to be?

Note that I explicitly, and for multiple reasons, do not want to utilise the system-wide location under /usr/lib

Sorry for off-topic, but I was wondering if you are interested to help grow LO community on libreoffice.org/hr/. Know there is not much users visit that site and you probably wont get answers as good as here on English version, but I just wanted to let you know that that site exists in case you’re interested. Thanks.

Don’t know if you looked here: Change folder where macros are stored. Not exactly what you’re looking for, but might give you a clue.

…assumed it is expecting it in ~/.config/libreoffice/4/user/Script/python/

Not quite; it should be:

~/.config/libreoffice/4/user/Scripts/python

However, if no other python files appear, then the issue is likely that you need to install python support as described here. A discussion from someone with the same problem is here.

sudo apt-get install libreoffice-script-provider-python

The APSO extension will help you create Python macros in the correct location: https://stackoverflow.com/a/47823475/5100564.