Skip to content

Conversation

@wpferguson
Copy link
Member

@wpferguson wpferguson commented Dec 10, 2025

This PR enables bundling the lua-scripts with the darktable release, removing the last barrier to entry for using the scripts.

The bundled scripts are the choice of last resort, so if the user already has the lua-scripts installed the user version takes priority.

The scripts can also run in a "hybrid" mode where the bundled scripts are used and selected scripts can be added by placing them in the users lua directory.

This PR is a work in progress. One final piece is needed to make it work and that is a modified script_manager. That will be merged separately into the lua-scripts repository and then accessed through the external/lua-scripts submodule.

For testing I'm included a modified script_manager that needs to replace /share/darktable/lua-scripts/tools/script_manager.lua

             Added a line to start tools/script_manager to handle
             figuring out where scripts are as well as starting and
             stopping them

external/CMakeLists.txt - Added step to install external/lua-scripts
                          into <install dir>/share/darktable/lua-scripts

lua/configuration.h - Bumped API to 9.7.0 since this is a change to
                      how the scripts are handled.  This change
                      doesn't break anything, so it didn't require
                      changing the major version.

lua/init.c - removed the step that runs the user luarc file.  This
             is now handled by script_manager. Added the <install dir>/
             share/darktable/lua-scripts to the lua search path.

The final part to make this work is a modified version of script_manager,
which would require updating the lua-scripts repository and then updating
the external library.  I'll hold off until 5.4(.1?) is released.  In the
meantime I'll include a modified version in the PR for testing.
@wpferguson wpferguson added feature: enhancement current features to improve wip pull request in making, tests and feedback needed lua labels Dec 10, 2025
@wpferguson wpferguson self-assigned this Dec 10, 2025
@wpferguson wpferguson added this to the 5.6 milestone Dec 10, 2025
@wpferguson
Copy link
Member Author

wpferguson commented Dec 10, 2025

Here's the correct script_manager file

script_manager.zip

EDIT: How to test this

  • Download a fresh copy of master
  • pull the PR to your fresh copy
  • do a git submodule update
  • unzip the above script_manager.zip and place the extracted file in src/external/tools (it replaces the old script_manager.lua)
  • if you have an existing lua scripts or luarc file in your config directory, then rename them.
  • compile and run. script_manager should appear and you should be able to start and stop scripts.

If you want to test a downloaded copy of the scripts repository

  • download the scripts to .config/darktable/lua. Replace the tools/script_manager.lua with the above version
  • start darktable and you'll be using the downloaded scripts.

That's where development is at this point. Succeeding versions of script_manager will enable more functionality

             headless because starting the scripts when darktable
             is headless results in a hang.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: enhancement current features to improve lua wip pull request in making, tests and feedback needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant