This is a Python plugin that imports Python plugins from zip files into the proper location in the resources directory. The user still needs to restart Krita and activate the imported plugins in the settings, but at least the most technical/complicated aspect of copying the files is automated. (While testing, I noticed that once you have enabled a plugin, you have to restart Krita again to make it show up in the menu. That seems like a bug?)
Since I didn't want to assume a specific directory structure inside the zip, the plugin uses the following strategy to find the correct files:
- Find files with the ending .desktop and read the Python module name from them
- Find directories that correspond to the Python module names and that contain an __init__.py file
- Find files with ending .action that have matching <Action name=...> tags (these files are optional)
Then the found desktop- and action-files and the Python module directories are extracted into the corresponding pykrita and actions folders. This approach is very flexible and doesn't seem too error-prone to me, as long as the zip files aren't too wild. (One could easily make the algorithm more restrictive, though, if needed.) I've tested it with a couple of Python plugins out there, on Linux as well as Windows.
The Plugin can be found under "Tools > Scripts > Import Python Plugin...". It's enabled by default.