flathub / flathub/org.darktable.Darktable

Host programms not runnable from flatpak darktable

Open
#86 16 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12
Forks
18
Avg merge
45m
Merged PRs (30d)
1

Description

Main reason for me to use lua scripts is to be able to
* open image in gimp
* Create HDR Image
* Reveal in file browser

However, when trying any of these lua scripts, they are blocked by not able to find the associated executable
in the flatpak sandbox, however the host apps are installed and work flawlessly.

Recently i came across a solution based on

https://github.com/flathub/org.gnu.emacs/issues/14

where the app can be started by flatpak-run.
This now works for me for HDRMerge, since i modified the file HDRMerge.lua like this:

```
local function BuildExecuteCmd(prog_table) --creates a program command using elements of the passed in program table
local result = 'flatpak-spawn --host '..CleanSpaces(prog_table.bin)..' '..CleanSpaces(prog_table.arg_string)..' '..CleanSpaces(prog_table.images_string)
return result
end

```
and added the dbus permission using flatseal to darktable.

This works perfectly, but needs to be done for every script which calls a host executable.

However it would be impractical to modify all scripts to also work in flatpak also.

### Proposal
Extend function
`'dtutils.system.external_command()`
to prepend the string "'flatpak-spawn --host "
to the exec command when running in flatpak environments.

Or add a new command "external_host_command()" which has these semantics, when the former should not be modified....

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with dtutils.system.external_command() and compare its behavior with the modified HDRMerge.lua example. Check how darktable detects Flatpak environments and how the required host-spawn permission is represented. Done means host executables can be invoked from Lua scripts without modifying each script, while existing non-Flatpak behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.