PORTALS.CONF(5) | File Formats Manual | PORTALS.CONF(5) |
portals.conf - XDG desktop portal configuration
$XDG_CONFIG_HOME/xdg-desktop-portal/{*-}portals.conf
$XDG_CONFIG_DIRS/xdg-desktop-portal/{*-}portals.conf
/etc/xdg-desktop-portal/{*-}portals.conf
$XDG_DATA_HOME/xdg-desktop-portal/{*-}portals.conf
$XDG_DATA_DIRS/xdg-desktop-portal/{*-}portals.conf
/usr/share/xdg-desktop-portal/{*-}portals.conf
xdg-desktop-portal uses a configuration file to determine which portal backend should be used to provide the implementation for the requested interface. This mechanism is very similar to the freedesktop.org specification for "Association between MIME types and applications" (mime-apps).
Desktop environments and OS vendors should provide a default configuration for their chosen portal backends in /usr/share/xdg-desktop-portal/DESKTOP-portals.conf, where DESKTOP is the desktop environment name as it would appear in the XDG_CURRENT_DESKTOP environment variable, after case-folding ASCII upper case to lower case. For example, KDE should provide /usr/share/xdg-desktop-portal/kde-portals.conf.
Users can override those defaults, or provide configuration for an otherwise unsupported desktop environment, by writing a file ~/.config/xdg-desktop-portal/portals.conf. Users of more than one desktop environment can use desktop-specific filenames such as kde-portals.conf which will only be used in the appropriate desktop environment.
Similarly, system administrators can provide a default configuration for all users in /etc/xdg-desktop-portal/DESKTOP-portals.conf or /etc/xdg-desktop-portal/portals.conf.
The following locations are searched for configuration, highest precedence first:
In each of those locations, for each desktop environment name listed in the XDG_CURRENT_DESKTOP environment variable, xdg-desktop-portal checks for xdg-desktop-portal/DESKTOP-portals.conf, where DESKTOP is the desktop environment name in lower-case. If a desktop-environment-specific configuration file is not found, a non-desktop-specific file xdg-desktop-portal/portals.conf will be read. For example, if XDG_CURRENT_DESKTOP is set to Budgie:GNOME, then xdg-desktop-portal will look for xdg-desktop-portal/budgie-portals.conf, xdg-desktop-portal/gnome-portals.conf and xdg-desktop-portal/portals.conf in that order.
Only the first configuration file found is read, and lower-precedence configuration files are ignored. All possible configuration files within one directory are tried before moving on to the next directory, so for example ~/.config/xdg-desktop-portal/portals.conf is higher-precedence than /usr/share/xdg-desktop-portal/kde-portals.conf.
The format of the portals configuration file is the same .ini format used by systemd unit files or application desktop files.
[preferred]
The following keys can be present in the preferred group:
default (string)
org.freedesktop.impl.portal.* (string)
Each key in the group contains a semi-colon separated list of portal backend implementation, to be searched for an implementation of the requested interface, in the same order as specified in the configuration file. Additionally, the special values none and * can be used:
none
*
[preferred] # Use xdg-desktop-portal-gtk for every portal interface... default=gtk # ... except for the Screencast interface org.freedesktop.impl.portal.Screencast=gnome
XDG_CURRENT_DESKTOP
XDG_CONFIG_HOME
XDG_CONFIG_DIRS
XDG_DATA_HOME
XDG_DATA_DIRS