# Using Native TeXLive with Flatpak Apps

Hi guys,

how can I use my local TeXLive installation with flatpak apps? Just giving access to the TeXLive folder was not enough; (as far as I understand) I have to set the PATHs for flatpak separately. How can I do that?

1 Like

as a general matter you can’t use binaries that are on the host (ie outside the sandbox).

However there is a texlive sdk which can be used to provide texlive.

1 Like

Is not an option in my case.

This is possible in snaps. Would it not be a great option to implement a way to use “external” binaries also for flatpak?

Hi.
This issue has been raised, and it is in fact possible to do so with most flatpak apps, by poking a hole in the confinement.
It goes against the idea of confined apps, but it’s not worse than having the program installed via deb/rpm, so for me it is worth it, until a proper solution pops up.
For example, TeXstudio will use the system apps automatically if you did not install (or remove) the texlive extension. In my case a reboot was necessary, but then it worked flawlessly.
In TeXworks you have to add a permission, either from flatseal or the cli. You have to add “org.freedesktop.Flatpak” to the talk permission on the system bus. Then you have to change the change the commands in the settings to use flatpak-spawn --host.

Thank you for the respond.

I add the permission `org.freedesktop.Flatpak` to system bus talk and change the command in TeXworks to `flatpak-spawn --host pdflatex`. I get the error message “pdflatex is not properly configured”.

Actually I need pdflatex in Xournal++; the error message there is: “Error: Child process exited with code 1. Please check the content of /tmp/xournalapp-2/tex”. I could not find any “…/tmp/xournalapp-2/tex” on my system.

The bus is actually the session bus, not the system bus, I was mistaken.
It works in the other programs, but not in xournal++.
I guess they might be doing something else with the command before it is executed

Did not solve the problem in TeXworks.

In texworks the commands need to be set as in the picture below, by adding flatpak-spawn as the command, --host as the first argument, then the real command:

If you want to change them all I uploaded a gist at TeXshop flatpak, tex host config · GitHub

You can save that file as ~/.var/app/org.tug.texworks/data/TUG/TeXworks/configuration/tools.ini

Nothing changed.

I used the command `flatpak-spawn --host pdflatex temp.tex` in the Geany terminal; the error is: `Portal call failed: org.freedesktop.DBus.Error.ServiceUnknown`.

Very strange. It works for me. I assume you have the xdg-desktop-portal program installed (should be by default). Although I’m not sure it is needed.
You added the `org.freedesktop.Flatpak` to the session bus in geany as well, right?

xdg-desktop-portal is installed.

Right.

Strange. It works for me