Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document HOST_XDG_* environment variables #426

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions docs/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ For some practical examples of bad IDs
``.desktop`` as a special case causing inconsistency. For this same reason, ``.Desktop`` suffixes
should not be used for newly named applications. Don't hesitate to repeat the application name
even if it already is part of the domain name section of the identifier (eg. ``org.example.Example``).

- ``io.github.Foo``

This is problematic because while ``foo.github.io`` may be unique to your project, it does not
include a project-specific identifier. This may cause issues if another project creates
``io.github.Foo-Bar`` which should be its own namespace but areas of ``flatpak`` may treat them
Expand Down Expand Up @@ -221,11 +221,16 @@ For example, GNOME Dictionary will store user-specific data in::

~/.var/app/org.gnome.Dictionary/data/gnome-dictionary

Note that applications can be configured to use non-default base directory
locations (see :doc:`sandbox-permissions`).
These environment variables are always set by flatpak and override any host values.
However if using the host directories are needed the ``$HOST_XDG_CONFIG_HOME``,
``$HOST_XDG_DATA_HOME``, ``$HOST_XDG_CACHE_HOME``, and ``$HOST_XDG_STATE_HOME`` environment
variables will be set if a custom value was set on the host.

Note that ``$XDG_STATE_HOME`` is only supported by Flatpak 1.13 and later. If
your app needs to work on earlier versions of Flatpak, you can use the
Note that ``$XDG_STATE_HOME`` and ``$HOST_XDG_STATE_HOME`` is only supported by Flatpak 1.13
and later. If your app needs to work on earlier versions of Flatpak, you can use the
``--persist=.local/state`` and ``--unset-env=XDG_STATE_HOME`` finish args so
the app will use the correct directory, even after Flatpak is later upgraded to
>1.13.

Note that applications can be configured to use non-default base directory
locations (see :doc:`sandbox-permissions`).