Convention for user-provided environment

Could we agree on a convention for snaps to pick up user-provided environment snippets? Something like sourcing $SNAP_USER_DATA/.env, say?

Does this make sense?

Maybe, do you have some use cases?

1 Like

The use case is to allowing passing custom env variables to snap without need to do it every time on cmdline or without editing desktop file for gui apps which may get out-of-sync with app updates.

How do you do this for non-snapped applications? Why can you not do it that way with your snapped applications?

For non-snapped applications I do the same as for snap however snap alternatives like flatpak or firejail have dedicated options for passing env variables to apps. Snap is currently behind those in that case.