suggested topics for darktable lua-scripts programming guide

I’ve started working on a programming guide for darktable’s Lua scripting. It’s intended to be the “how to” manual to go with the API manuals.

So far I have:

  • infrastructure - Where all the pieces (lua directories, luarc files, etc) go and how they work together to run the scripts
  • anatomy of a script - what a script looks like, what the pieces do
  • the event system - what the event system is, how it works, how the events are triggered, how to use them, tips and tricks.
  • collections, selections, act on images
  • building a user interface
  • creating storages (exporters)
  • creating modules
  • build your own exporter (not a storage)
  • automating the UI
  • selecting images (adding a button to the select module)
  • acting on selected images (adding a button to the selected images module)
  • logging and debugging
  • multitasking

If there is a topic you would like to see, then add a comment

14 Likes

Sounds very comprehensive!

8 years of trial and error. Figured I’d share some of the lessons I learned.

5 Likes

One of the coolest features of the Lua scripting, to me, is building your own UI elements. I figured out how that’s done from various examples, but I’d have appreciated a tutorial for it in the docs. The interplay with the CSS theming is interesting, too.

1 Like

Yes, please, Bill!

2 Likes

That sounds like a great idea Bill!

I know I initially struggled to understand the overall flow of lua scripts - the interaction between darktable and the script - e.g. when different functions got called - on initialisation as DT started up or when called via an export or callback in a module, and persistence of variables etc.

Probably basic stuff but having it laid out clearly and unambiguously would be really useful (tho may trigger a big refactoring of my scritps once I understand how I should have done things!)

Hi Bill,
I really appreciate the work you have done. I personally feel your script that allows exporting to collection should be part of the standard DT features because it is so useful and logical.

I look forward to your guide and hopefully it will give me the skills to try and learn to write some of my own scripts.