flatpak-docs icon indicating copy to clipboard operation
flatpak-docs copied to clipboard

add tmpdir env var export to launch app

Open Lunarequest opened this issue 4 years ago • 4 comments

This allows for zypak to share the chromium singleton between instances. This is useful when apps are launched via xdg-open from other flatpaks as normally this would start another instance of the app.

Lunarequest avatar Jul 20 '21 04:07 Lunarequest

This is no longer needed with flatpak 1.11.1

TingPing avatar Jul 21 '21 02:07 TingPing

I've had people report issues unless this was exported

Lunarequest avatar Jul 21 '21 03:07 Lunarequest

It is needed but for other reasons. Electron applications often pack their status icons or whatever inside the asar which tries to extract to /tmp/.chromium-xxxxx but /tmp is unavailable unless explicitly granted access. So they end up going nowhere.

In that case setting TMPDIR to say $XDG_CACHE_HOME/tmp allows it to be self contained while things work.

Giving access to /tmp just for that is a bad idea.

Eg. https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/blob/f83d036fb83d6302750507714c330cd2c610ef7e/src/backend/constants.ts#L75-L77

bbhtt avatar Nov 08 '23 02:11 bbhtt

It is complicated because setting TMPDIR to a non-tmpfs ($XDG_CACHE_HOME/tmp) has other implications, like the files will persist forever on disk.

The best solution depends on the specific problem.

TingPing avatar Nov 08 '23 20:11 TingPing