Calling lua from dbus requires "local darktable = require 'darktable' \n" to be prefixed to any attempt to access the lua api
I tried to call darktable's Lua api over dbus but came to the conclusion that it's not directly available using the Remote method in the dbus interface.
If I prefix
local darktable = require 'darktable'\n to the parameter string containing the Lua api call it does work.
Here is the short bit of testing code I wrote in Python3:
bus = dbus.SessionBus()
proxy = bus.get_object('org.darktable.service', '/darktable')
lua_method = proxy.get_dbus_method('Lua', dbus_interface='org.darktable.service.Remote')
lua_method('local darktable = require "darktable" \n darktable.gui.current_view(darktable.gui.views.darkroom)')
It seems to me that it would make sense to make the Lua api accessible over dbus without getting a local reference to darktable first.
One implication of this is that the return value from the actual darktable Lua api call gets lost as it seems dbus only returns the return value of the first Lua command it processes.
I run darktable 2.2.1 on BunsenLabs GNU/Linux 9.5 (Helium) with kernel Linux 4.9.0-7-amd64(x86_64).
This is the version of darktable that I installed using the default repositories of BunsenLabs.
Any help is appreciated and I will of course provide additional info if needed.