Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Lua script for set color label on group images
Set color labels to group
Script to provide shortcuts for setting color labels in images groups.
Useful for those who are RAW+JPEG shooters.
Installation and usage:
1. Copy this file into ~/.config/darktable/lua/
2. Add `require "colorlabel_group"` to new line in ~/.config/darktable/luarc
3. Restart darktable
4. Assign a keyboard shortcut to each action via daktable preferences > shortcuts > lua
I use the following shortcuts:
Set group red - CRTL+F1
Set group yellow - CRTL+F2
Set group green - CRTL+F3
Set group blue - CRTL+F4
Set group purple - CRTL+F5
Author: Diego Cesar (,
License: GPLv2
This script is based on based on Dom H ( work for rating group images
local dt = require "darktable"
local function apply_label(color)
local images = dt.gui.action_images
for _, i in ipairs(images) do
local members = i:get_group_members()
for _, m in ipairs(members) do
if color == "blue" then = true
elseif color == "red" then = true
elseif color == "yellow" then
m.yellow = true
elseif color == "green" then = true
elseif color == "purple" then
m.purple = true
dt.print("applying color " ..color.. " to group(s)")
dt.register_event("shortcut",function(event, shortcut)
end, "Set group red")
dt.register_event("shortcut",function(event, shortcut)
end, "Set group yellow")
dt.register_event("shortcut",function(event, shortcut)
end, "Set group green")
dt.register_event("shortcut",function(event, shortcut)
end, "Set group blue")
dt.register_event("shortcut",function(event, shortcut)
end, "Set group purple")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.