Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Ouvrir le dossier d'origine de l'image à partir de DT ?
#18
Suite au passage à la version 2.2, l'api Lua à changé un peu et j'ai du en conséquence modifier le script. Voici la version à jour :
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.."'"
 dt.print_error("command="..command)
 dt.control.execute(command)

end

dt.register_event("shortcut",fnav_shortcut,
"Lancer le navigateur de fichiers")
Mes photos : jpverrue.fr
Répondre


Messages dans ce sujet
RE: Ouvrir le dossier d'origine de l'image à partir de DT ? - par jpverrue - 01-03-17, 17:38

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)