For Firefox
Starting with version 64, Firefox can optionally use XDG Desktop Portals to handle various desktop features, such as opening a file picker, or handling MIME types. — Arch Wiki | Firefox | XDG Desktop Portal integration
- Type
about:configin Firefox address bar. - Search
widget.use-xdg-desktop-portal.file-picker, set it to 1.- 0 – Never
- 1 – Always
- 2 – Auto (typically depends on whether Firefox is run from within Flatpak or whether the
GDK_DEBUG=portalsenvironment is set)
- Done.
For VS Code
These two environment variables: GTK_USE_PORTAL=1, GDK_DEBUG=portals.
Method 1:
- Set environment variable
GTK_USE_PORTIAL=1. - Add it to your Fish shell (or other shells you use) alias:
alias code "GTK_USE_PORTAL=1 code"
Method 2:
- Press Meta key to open Application Launcher.
- Search for Visual Studio Code.
- Right click > Edit Application…
- In the popup window, choose Application tab.
- Fill the “Environment variable” field:
GTK_USE_PORTIAL=1.
But it’s not working on my machine. So I actually use method 1.
Reference: