Hello. I have been trying to figure out if there is any way to programmatically change the darktable theme. Obligatory, I know the default theme is middle grey for a reason, I use it the vast majority of the time. I made a script to change my system theme when I am in a dark environment, and my end goal is to hook darktable into that as well. My “dark environment” darktable theme is only slightly darker then the default. Currently, I only have so much control over my editing environment, and unfortunately I cannot control the sun.
All that said, my first hope was to use the darktables dbus interface, something like:
dbus-send --type=method_call --dest=org.darktable.service /darktable org.darktable.service.Remote.Lua string:"local dt = require('darktable') dt.preferences.write('gtk', 'theme', 'string', 'darktable-slightly-darker')"
But as the documentation for dt.preferences
notes:
Lua has its own namespace for preferences and you can’t write normal darktable preferences.
As far as I understand, this will not set the correct key in darktablerc
. Even if it did, I think this would require a restart to take effect, which I want to avoid.
My next idea was using dt.gui.action
, but with further reading I concluded it’s not possible to set preferences this way.
Running out of ideas I grepped through darktables source code and see dt_gui_load_theme(theme)
quite a bit, I am not a programmer, I do not know c
, but I do wonder if there is a method to call said function via lua
?
In summary, if any of you have ideas on how to programmatically change darktables gui theme (during runtime, no restart) I would very much appreciate your thoughts!
Thanks for your time.