Debian Codegraph @

doc/portals.conf.rst.in

raw
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 Only the first configuration file found is read, and lower-precedence
81 configuration files are ignored. All possible configuration files within
82 one directory are tried before moving on to the next directory, so for
83 example ``~/.config/xdg-desktop-portal/portals.conf`` is higher-precedence
84 than ``/usr/share/xdg-desktop-portal/kde-portals.conf``.
85
86 FILE FORMAT
87 -----------
88
89 The format of the portals configuration file is the same ``.ini`` format used by
90 systemd unit files or application desktop files.
91
92 ``[preferred]``
93
94 The main configuration group for preferred portals.
95
96 The following keys can be present in the ``preferred`` group:
97
98 ``default`` *(string)*
99
100 The default portal backend to use for every interface, unless the interface
101 is listed explicitly.
102
103 ``org.freedesktop.impl.portal.*`` *(string)*
104
105 One of the valid portal interface implementations exposed by
106 xdg-desktop-portal.
107
108 Each key in the group contains a semi-colon separated list of portal backend
109 implementation, to be searched for an implementation of the requested interface,
110 in the same order as specified in the configuration file. Additionally, the
111 special values ``none`` and ``*`` can be used:
112
113 ``none``
114
115 Do not provide a portal implementation for this interface.
116
117 ``*``
118
119 Use the first portal implementation found, in lexicographical order.
120
121 EXAMPLE
122 -------
123
124 ::
125
126 [preferred]
127 # Use xdg-desktop-portal-gtk for every portal interface...
128 default=gtk
129 # ... except for the ScreenCast interface
130 org.freedesktop.impl.portal.ScreenCast=gnome
131
132
133 ENVIRONMENT
134 -----------
135
136 ``XDG_CURRENT_DESKTOP``
137
138 A colon-separated list of desktop environments, most specific first,
139 used to choose a desktop-specific portal configuration.
140 The default is an empty list.
141
142 ``XDG_CONFIG_HOME``
143
144 The per-user ``portals.conf`` file is located in this directory. The default
145 is ``$HOME/.config``.
146
147 ``XDG_CONFIG_DIRS``
148
149 A colon-separated list of system configuration directories and secondary
150 per-user configuration directories. The default is ``/etc/xdg``.
151
152 ``XDG_DATA_HOME``
153
154 A per-user data directory, searched for consistency with other
155 specifications. The default is ``$HOME/.local/share``.
156
157 ``XDG_DATA_DIRS``
158
159 A colon-separated list of system data directories and secondary per-user
160 data directories. The default is ``/usr/local/share:/usr/share``.
161
162 SEE ALSO
163 --------
164
165 - `XDG Base Directory Specification <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_
166 - `XDG Desktop Entry specification <https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html>`_
167 - `XDG Association between MIME type and applications specification <https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html>`_