I'm using Kubuntu 18.10 and have the default file manager, Dolphin, set up quite nicely with servers, favorites etc. in the sidebar.
Now, whenever I want to open a file or folder from within a program, this file picker opens:
Now, many programs open this file/folder picker instead of the Dolphin file picker:
EDIT: This happens for example in Sublime Text and Firefox. Preinstalled programs (e. g. Spectacle or Kate) seem to actually do display a Dolphin file picker!
Is there any way to replace this with the Dolphin file picker, or at least get my favorites etc. into whatever this program is?
You want applications to use the KDE file selection dialog so that you can have the appearance matching that of Dolphin.
As you have seen, native applications such as Spectacle do conform, but others don't. This is probably because the non-conforming applications are gtk-based and use the GTK file selection dialog:
Firefox uses the gtk file selection dialog by default
To get Firefox, which is a gtk application, to use the KDE file selection dialog, start it from a terminal like this:
Now, you'll see
Similarly, you can make gedit, and other gtk applications, use the KDE file selection dialog.
Here's what you'll see with
GTK_USE_PORTAL=1 gedit
:If you're sure you want to consistently use the KDE file selection dialog, you can add
export GTK_USE_PORTAL=1
to the end of ~/.profile. After you log out and log back in, all applications will use the KDE file selection dialog.Note that the following two packages should be present in your system:
The problem
Most GTK - based apps (like Firefox) will open the GTK file picker ("Nautilus") by default, independent of the current desktop environment.
The (temporary) solution
However most GTK apps support using xdg desktop portals. As a prerequisite make sure you have the packages
xdg-desktop-portal
andxdg-desktop-portal-kde
installed and up-to-date. To check if a GTK application supports desktop portals, launch it from the console with environment variableGTK_USE_PORTAL=1
set. For example, to launch Firefox and test the file picker runGTK_USE_PORTAL=1 firefox
from your command line. If an application still uses Nautilus even when launched like this, it uses a GTK version which doesn't support the environment variable or the desktop portals. In this case you can't do anything but hope that the program is open-source and you can fix it yourself. There is another alternative, but it is very hacky and I wouldn't recommend itPermanent solution
To make all apps launch with the environment variable set, create a KDE session environment variable (see KDE UserBase wiki for reference):
xdg-desktop-portal
andxdg-desktop-portal-kde
$HOME/.config/plasma-workspace/env
exists.sh
file in the directory, with any name and the contentexport GTK_USE_PORTAL=1
KDE will execute any.sh
script found in that directory on startup and maintain the environment variables set in them.Note that this will only work as long as you use a KDE session. If you are switching to a Gnome session, the environment variable will obviously not get set by KDE and all applications will revert to their default.
Why not
.profile
?Most solutions I found online recommend to set the permanent environment variable in the
.profile
file. While this works for Flatpak apps, it doesn't seem to work for native apps (as of today). Setting it as a KDE session environment variable works also for most native apps (if they support it).Installation helped me (from pacman-manager)
xdg-desktop-portal-gtk
from this post https://bugzilla.mozilla.org/show_bug.cgi?id=1639575#c17 enter image description here