25-07-16, 10:54
Voilà un premier jet. Ça me semble bien répondre à la question initiale, mais je suis ouvert à toute demande/proposition/critique ;-)
<pre></pre>
<pre>
Code :
--[[
FNAV
launch file navigator in photo directory with a shortcut
AUTHOR
Jean-Pirre Verrue (contact@jpverrue.fr)
INSTALLATION
* copy this file in $CONFIGDIR/lua/ where CONFIGDIR
is your darktable configuration directory
* add the following line in the file $CONFIGDIR/luarc
require "fnav"
USAGE
* configure this script :
set a shortcut in preferences->shortcut->lua
set file navigator path in preferences->lua options
set file navigator options in preferences->lua options
* select a photo
* type your shortcut
* after use dont forget to close file navigator window !
LICENSE
GPLv2
]]
local dt = require "darktable"
dt.preferences.register("file_navigator","navigator_options",
"string","options",
"options du navigateur de fichier","")
dt.preferences.register("file_navigator","navigator_path",
"string","navigateur de fichiers",
"chemin complet du navigateur de fichier","")
local function fnav_shortcut(event, shortcut)
local images = dt.gui.action_images
local image_path = tostring(images[1].path)
local navigator_path = dt.preferences.read("file_navigator", "navigator_path", "string")
local navigator_options = dt.preferences.read("file_navigator", "navigator_options", "string")
local command = navigator_path.." "..navigator_options.." "..image_path
if coroutine.yield("RUN_COMMAND", command) then
dt.print_error(command.." failed")
end
end
dt.register_event("shortcut",fnav_shortcut,
"Lancer le navigateur de fichiers")
Mes photos : jpverrue.fr