Sample Header Ad - 728x90

How is `flatpak override --env=FOO=bar some.app.id` suppose to work?

0 votes
0 answers
85 views
I thought that I could: 1) Use override to set an env for some flatpak 2) And then every time I run this app 3) If I enter in the process (to be sure, I did this for all 3 types of pids: instance,pid,child-pid) and execute printenv I would have expected to see the FOO=barenvironment being set at lest for some of them, but it's not. What am I missing? Test:
flatpak override --user --env=FOO=bar com.github.PintaProject.Pinta
flatpak info -M com.github.PintaProject.Pinta; echo # To verify flatpak understood setting the override
flatpak run com.github.PintaProject.Pinta &
sleep 1
flatpak ps --columns=instance,pid,child-pid,application |
  grep -i pinta | sed 's_'$'\t''*[^0-9]*$__' |
  xargs -d $'\t' -I_ sh -c 'echo Envs of instance $0; flatpak enter $0 printenv; echo' '_'
Output:
[Context]
shared=network;ipc;
sockets=x11;wayland;fallback-x11;
devices=dri;
filesystems=xdg-templates;xdg-pictures;xdg-public-share;xdg-run/gvfs;/run/media;xdg-run/gvfsd;xdg-documents;xdg-desktop;xdg-download;

[Session Bus Policy]
org.gtk.vfs.*=talk

[Environment]
FOO=bar

Envs of instance 987116797
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
TERM=xterm-256color

Envs of instance 1399677
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
TERM=xterm-256color

Envs of instance 1399691
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
TERM=xterm-256color
Asked by Timo (683 rep)
Feb 27, 2025, 03:42 PM
Last activity: Feb 27, 2025, 03:47 PM