lua-scripts icon indicating copy to clipboard operation
lua-scripts copied to clipboard

Scripts can't start until lighttable mode is active

Open wpferguson opened this issue 8 months ago • 1 comments

https://github.com/darktable-org/darktable/pull/5959 fixed a darktable hanging issue by delaying scripts startup until the GUI entered lighttable.

Scripts that don't have a UI should be safe to start.

Scripts that do have a UI may be safe to start so that shortcut functionality is available without the UI being created until in lighttable mode.

Discussion: https://discuss.pixls.us/t/minor-problem-with-lua-scripts-only-loading-if-darktable-opens-lighttable-view/

wpferguson avatar Apr 26 '25 17:04 wpferguson

I think I've figured out a solution to this.

For "interactive" scripts such as rename_images and image_time, input is required in order to perform the function.

For other lib scripts that mostly input configuration, the script can be split into a "config" part the runs in lighttable and a "runner" that actually performs the function either by event or shortcut. This way more scripts are available when darktable is opened in darkroom view. When the "config" part of the script is used to update configuration, an event can be sent to the "runner" to reload configuration.

wpferguson avatar Dec 02 '25 03:12 wpferguson