lua-scripts
lua-scripts copied to clipboard
support for system wide installed scripts
To make it easier for people to run lua scripts it might be an idea to provide native packages (deb,rpm) for the lua scripts
They could live e.g. in $(prefix)/share/darktable/scripts
.
- The manager should prefer scripts installed into the user home over system wide copies.
- it should ask the user to upgrade scripts via the package manager if they are installed in the system wide dir or ask if a copy in the home should be installed.
I looked at itand here's what I came up with
- scripts should probably live in
$(prefix)/share/darktable/lua/scripts
- I need to modify src/lua/init.c to add another search path after the config dir
- I need to modify the darktable luarc file to use the scripts directory if it exists and there isn't a copy of the scripts in the users config dir and launch script manager
- I need to modify script_manager to be aware of the "system" scripts directory and deal with it properly
Just my comments:
Perhaps darktable should work more like GIMP.
- GIMP loads all files in the script directories no special file like the luarc. Is it possible to change dt to do the same.
- GIMP as a list of directories in the preferences, that can be extended by the user to look for the scripts. (This is just nice to have.)
@darix Where would you like to safe the files you need for the packages? How is it handled in other projects?
The path suggested by @wpferguson is perfect imho.
GIMP loads all files in the script directories no special file like the luarc. Is it possible to change dt to do the same
The difference is that GIMP just adds a menu entry. If we started all the scripts, as of today, that would add 21 modules to the lighttable UI. If we install the modules as a package, then script_manager becomes the default interface to the scripts (kind of like GIMP's menus). I'll add a check to see if the user has a luarc file in the config directory and use it if it exists, otherwise script_manager will start.
GIMP as a list of directories in the preferences, that can be extended by the user to look for the scripts. (This is just nice to have.)
This is doable. We just have to add them to package.path in the right place. Currently <config_dir>/lua
is the last entry. I'm planning on adding <prefix>/share/darktable/lua/scripts
as the last entry, so the if <config_dir>/lua
exists that will get used first. We could add other path entries either before or after <config_dir>/lua using preferences or an extension to script_manager. Actually adding it to script_manager makes more sense because the path could immediately be modified, the new location scanned for scripts, and whatever scripts are found could be added to script_manager on the fly.
any update on this?
I've been swamped by real life and just haven't got to it yet. Things should let up around the April/May time frame and I'll start cleaning up all the loose ends and left over issues.