flatpak / flatpak-xdg-utils

Simple portal-based commandline tools for use inside flatpak sandboxes
GNU Lesser General Public License v2.1
32 stars 14 forks source link

no DISPLAY environment variable specified #62

Closed dmytri closed 1 year ago

dmytri commented 1 year ago

When using flatpak-spawn I get "no DISPLAY environment variable specified" though DISPLAY is in env and is correct

[dk@sys dk]$ echo $DISPLAY
:20

it works as expected if I enter bash and then run firefox with DISPLAY set

[dk@sys dk]$ distrobox-host-exec bash
[dk@localhost dk]$ DISPLAY=:20 firefox
flatpak-spawn --host firefox
Error: no DISPLAY environment variable specified

But adding the env works

flatpak-spawn --host --env=DISPLAY=$DISPLAY firefox

Running in an archlinux container

pacman -Q flatpak-xdg-utils
flatpak-xdg-utils 1.0.5-1
TingPing commented 1 year ago

It doesn't automatically pass everything through as it really doesn't make sense to. What DISPLAY equals in the sandbox doesn't even necessarily match the host.

TingPing commented 1 year ago

The environment it gets spawned in is up to the environment of the systemd service org.freedesktop.portal.Flatpak.

dmytri commented 1 year ago

Thanks, that makes sense