30-09-21, 18:01
Une petite correction cosmétique :
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 = string.gsub(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..'"'
dt.print_log("command="..command)
dt.control.execute(command)
end
dt.register_event("fnav", "shortcut",fnav_shortcut,
"Lancer le navigateur de fichiers")
Mes photos : jpverrue.fr