Lua script "OpenInExplorer" not working

Recently I set up a Linux (Mint 22) and darktable (4.8.1, Flatpak version).
I noticed that the “OpenInExplorer” script is not working. The default file manager in Linux Mint is Nemo (version 6.2.8). I’m aware that Nemo is not mentioned in the user manual. Does this mean that the script does not support this file manager?
I also tried to change some Flatpak permissions (in Flatseal), but to no avail.
Has anyone out there any ideas, how to enable this script for Nemo file manager in Mint 22?

regards,
Janko

what command are you using to try and launch nemo?

As far as I understand (but maybe i’m wrong) in darktable there is no way to adjust the command for launching the file manager. A click on the “show in file explorer” button (in “actions on selection”) should be sufficient.
On the OS level, Nemo is started through a launcher with the “nemo %U” command

You can try what is suggested here: How do you set the path to the Hugin executable (Linux) · Issue #501 · darktable-org/lua-scripts · GitHub

Thank you for the suggestion. But in “Executable manager” I have only “git” as current application and no way to add other apps. The drop-down menu is, apart from “git”, completely empty …

understood. you may need to apply your own patches ontop of the lua git repo in order to get it to work with flatpak and nemo.

Thank you for your help, but this seems to be something beyond my computer/programming knowledge - I’m not a software engineer - so I’ll have to drop it for now.
Fortunately, this is not a crucial functionality, but something that can speed up a little bit the work with image files, and therefore a very nice addition to darktable tools.

If you look in the code it calls the filemanager using this means…

https://www.freedesktop.org/wiki/Specifications/file-manager-interface/

and it seems that relates to Dolphin or Nautilus which seems like it jives with the manual so I guess that is it… I’m not a Linux guy …but also it should be possible to alter the code…

/==
–Format strings for the commands to open the corresponding OS’s file manager.
local open_dir = {}
open_dir.windows = “explorer.exe /n, %s”
open_dir.macos = “open %s”
open_dir.linux = [[busctl --user call org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1 ShowFolders ass 1 %s “”]]

local open_files = {}
open_files.windows = “explorer.exe /select, %s”
open_files.macos = “osascript -e ‘tell application "Finder" to (reveal {%s}) activate’”
open_files.linux = [[busctl --user call org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1 ShowItems ass %d %s “”]]
==/

The linux parts in @priort 's code extract use DBus, which can be configured separately (so in theory, no intervention needed on the Lua code). The references to Dolphin and Nautilus are there because those are the default file managers for KDE and GNOME, resp. (afaik, the most used desktop environments).

Is Nemo the default file manager? And it must support DBus for that code to work (which it seems to do).

I think the relevant files are in /usr/share/dbus-1 and ~/.local/share/dbus-1, and their subdirectories.

1 Like

Thank you both for your comments and information.
Yes, Nemo is the default manager in Linux Mint Cinnamon, as I mentioned in my initial post.
~/.local/share/dbus-1 does not exist on my system.
in /usr/share/dbus-1 there are only three files containing some relevant information:

  1. nemo.FileManager1.service
[D-BUS Service]
Name=org.freedesktop.FileManager1
Exec=/usr/bin/nemo --no-default-window
  1. nemo.service
[D-BUS Service]
Name=org.Nemo
Exec=/usr/bin/nemo --no-default-window
  1. org.nemo.Preview.service
[D-BUS Service]
Name=org.nemo.Preview
Exec=/usr/bin/nemo-preview

You are likely getting sandboxed by the flatpak.

Access to the entire bus with --socket=system-bus or --socket=session-bus stops the filtering and using them is a security risk. So they must be avoided, unless the application is a development tool.

flatpak run --log-session-bus $FLATPAK_ID can be used to find the specific D-Bus permissions needed

From https://docs.flatpak.org/en/latest/sandbox-permissions.html

I couldn’t resist…

@JankoK I hope you dig your way out of the sand… :slight_smile:

https://images.app.goo.gl/XQrbyKiA2pUmSzsd8

1 Like

This is becoming increasingly complex. I’m wondering if it would’ve been easier to forget flatpak, and compile darktable from source. But i’m lacking reasonably straightforward instructions, and probably the knowledge to do it, as I’ve got a solid Windows experience, but not so much in Linux.

Clone the repo and run the build.sh shell script.

Thanks! No preparation work? No required pre-installed software or libraries?

Fairly comprehensive instructions here if you scroll down…

I mean yeah… But that should be relatively straight forward.

I just successfully built darktable (4.8.1) from source (on Mint Cinnamon 22). Thank you guys for your help.
After import the edits were well transferred from the previous (flatpak) installation, and even some from my Windows installation.

There is only one problem: lua module is not shown on screen.

The luarc file containing require "tools/script_manager" is located in ~/.config/darktable, executing git pull in ~/.config/darktable/lua directory returns “Already up to date.”

Is there anything else I should check?

Start it from the terminal with darktable -d lua

This is the output in the terminal:

darktable 4.8.1
Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> DISABLED
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

So Lua is disabled in compilation. I shall probably have to recompile, but how do I enable the Lua modules?
I just followed the instructions from here, and according to this Lua should be enabled …