| 1 |
============ |
| 2 |
portals.conf |
| 3 |
============ |
| 4 |
|
| 5 |
-------------------------------- |
| 6 |
XDG desktop portal configuration |
| 7 |
-------------------------------- |
| 8 |
|
| 9 |
:Manual section: 5 |
| 10 |
:Manual group: File Formats Manual |
| 11 |
|
| 12 |
.. _synopsis: |
| 13 |
|
| 14 |
SYNOPSIS |
| 15 |
======== |
| 16 |
|
| 17 |
*$XDG_CONFIG_HOME/xdg-desktop-portal/{\*-}portals.conf* |
| 18 |
|
| 19 |
*$XDG_CONFIG_DIRS/xdg-desktop-portal/{\*-}portals.conf* |
| 20 |
|
| 21 |
*@SYSCONFDIR@/xdg-desktop-portal/{\*-}portals.conf* |
| 22 |
|
| 23 |
*$XDG_DATA_HOME/xdg-desktop-portal/{\*-}portals.conf* |
| 24 |
|
| 25 |
*$XDG_DATA_DIRS/xdg-desktop-portal/{\*-}portals.conf* |
| 26 |
|
| 27 |
*@DATADIR@/xdg-desktop-portal/{\*-}portals.conf* |
| 28 |
|
| 29 |
DESCRIPTION |
| 30 |
=========== |
| 31 |
|
| 32 |
xdg-desktop-portal uses a configuration file to determine which portal backend |
| 33 |
should be used to provide the implementation for the requested interface. |
| 34 |
This mechanism is very similar to the freedesktop.org specification for |
| 35 |
"Association between MIME types and applications" (mime-apps). |
| 36 |
|
| 37 |
Desktop environments and OS vendors should provide a default configuration |
| 38 |
for their chosen portal backends in |
| 39 |
``/usr/share/xdg-desktop-portal/DESKTOP-portals.conf``, where ``DESKTOP`` |
| 40 |
is the desktop environment name as it would appear in the |
| 41 |
``XDG_CURRENT_DESKTOP`` environment variable, after case-folding ASCII |
| 42 |
upper case to lower case. |
| 43 |
For example, KDE should provide ``/usr/share/xdg-desktop-portal/kde-portals.conf``. |
| 44 |
|
| 45 |
Users can override those defaults, or provide configuration for an otherwise |
| 46 |
unsupported desktop environment, by writing a file |
| 47 |
``~/.config/xdg-desktop-portal/portals.conf``. Users of more than one |
| 48 |
desktop environment can use desktop-specific filenames such as |
| 49 |
``kde-portals.conf`` which will only be used in the appropriate desktop |
| 50 |
environment. |
| 51 |
|
| 52 |
Similarly, system administrators can provide a default configuration for |
| 53 |
all users in ``/etc/xdg-desktop-portal/DESKTOP-portals.conf`` or |
| 54 |
``/etc/xdg-desktop-portal/portals.conf``. |
| 55 |
|
| 56 |
The following locations are searched for configuration, highest precedence |
| 57 |
first: |
| 58 |
|
| 59 |
- ``$XDG_CONFIG_HOME``, defaulting to ``~/.config`` |
| 60 |
- each directory in ``$XDG_CONFIG_DIRS``, defaulting to ``/etc/xdg`` |
| 61 |
- the build-time ``sysconfdir`` for xdg-desktop-portal, usually ``/etc`` |
| 62 |
- ``$XDG_DATA_HOME``, defaulting to ``~/.local/share`` |
| 63 |
(searched only for consistency with other specifications, writing |
| 64 |
configuration here is not recommended) |
| 65 |
- each directory in ``$XDG_DATA_DIRS``, defaulting to ``/usr/local/share:/usr/share`` |
| 66 |
- the build-time ``datadir`` for xdg-desktop-portal, usually ``/usr/share`` |
| 67 |
|
| 68 |
In each of those locations, for each desktop environment name listed in the |
| 69 |
``XDG_CURRENT_DESKTOP`` environment variable, xdg-desktop-portal checks for |
| 70 |
``xdg-desktop-portal/DESKTOP-portals.conf``, where ``DESKTOP`` is the |
| 71 |
desktop environment name in lower-case. If a desktop-environment-specific |
| 72 |
configuration file is not found, a non-desktop-specific file |
| 73 |
``xdg-desktop-portal/portals.conf`` will be read. |
| 74 |
For example, if ``XDG_CURRENT_DESKTOP`` is set to ``Budgie:GNOME``, |
| 75 |
then xdg-desktop-portal will look for |
| 76 |
``xdg-desktop-portal/budgie-portals.conf``, |
| 77 |
``xdg-desktop-portal/gnome-portals.conf`` and |
| 78 |
``xdg-desktop-portal/portals.conf`` in that order. |
| 79 |
|
| 80 |
FILE FORMAT |
| 81 |
----------- |
| 82 |
|
| 83 |
The format of the portals configuration file is the same ``.ini`` format used by |
| 84 |
systemd unit files or application desktop files. |
| 85 |
|
| 86 |
``[preferred]`` |
| 87 |
|
| 88 |
The main configuration group for preferred portals. |
| 89 |
|
| 90 |
The following keys can be present in the ``preferred`` group: |
| 91 |
|
| 92 |
``default`` *(string)* |
| 93 |
|
| 94 |
The default portal backend to use for every interface, unless the interface |
| 95 |
is listed explicitly. |
| 96 |
|
| 97 |
``org.freedesktop.impl.portal.*`` *(string)* |
| 98 |
|
| 99 |
One of the valid portal interface implementations exposed by |
| 100 |
xdg-desktop-portal. |
| 101 |
|
| 102 |
Each key in the group contains a semi-colon separated list of portal backend |
| 103 |
implementation, to be searched for an implementation of the requested interface, |
| 104 |
in the same order as specified in the configuration file. Additionally, the |
| 105 |
special values ``none`` and ``*`` can be used: |
| 106 |
|
| 107 |
``none`` |
| 108 |
|
| 109 |
Do not provide a portal implementation for this interface. |
| 110 |
|
| 111 |
``*`` |
| 112 |
|
| 113 |
Use the first portal implementation found, in lexicographical order. |
| 114 |
|
| 115 |
EXAMPLE |
| 116 |
------- |
| 117 |
|
| 118 |
:: |
| 119 |
|
| 120 |
[preferred] |
| 121 |
# Use xdg-desktop-portal-gtk for every portal interface... |
| 122 |
default=gtk |
| 123 |
# ... except for the ScreenCast interface |
| 124 |
org.freedesktop.impl.portal.ScreenCast=gnome |
| 125 |
|
| 126 |
|
| 127 |
ENVIRONMENT |
| 128 |
----------- |
| 129 |
|
| 130 |
``XDG_CURRENT_DESKTOP`` |
| 131 |
|
| 132 |
A colon-separated list of desktop environments, most specific first, |
| 133 |
used to choose a desktop-specific portal configuration. |
| 134 |
The default is an empty list. |
| 135 |
|
| 136 |
``XDG_CONFIG_HOME`` |
| 137 |
|
| 138 |
The per-user ``portals.conf`` file is located in this directory. The default |
| 139 |
is ``$HOME/.config``. |
| 140 |
|
| 141 |
``XDG_CONFIG_DIRS`` |
| 142 |
|
| 143 |
A colon-separated list of system configuration directories and secondary |
| 144 |
per-user configuration directories. The default is ``/etc/xdg``. |
| 145 |
|
| 146 |
``XDG_DATA_HOME`` |
| 147 |
|
| 148 |
A per-user data directory, searched for consistency with other |
| 149 |
specifications. The default is ``$HOME/.local/share``. |
| 150 |
|
| 151 |
``XDG_DATA_DIRS`` |
| 152 |
|
| 153 |
A colon-separated list of system data directories and secondary per-user |
| 154 |
data directories. The default is ``/usr/local/share:/usr/share``. |
| 155 |
|
| 156 |
SEE ALSO |
| 157 |
-------- |
| 158 |
|
| 159 |
- `XDG Base Directory Specification <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_ |
| 160 |
- `XDG Desktop Entry specification <https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html>`_ |
| 161 |
- `XDG Association between MIME type and applications specification <https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html>`_ |