Skip to content

Use the KRun strategy instead of DBus in Linux too to open a file manager

Using DBus to open a file manager opens an unpredictable file manager[1] so better use KRun, which unlike DBus, honors the user configuration for preferred file manager.

[1] Actually, the priority seems to be defined by readdir in the /usr/share/dbus-1/services/ directory. Which means if a user has Nautilus (which installs an org.freedesktop.FileManager1.service service file) and Dolphin (which installs an org.kde.dolphin.FileManager1.service service file), then Nautilus is always executed instead of Dolphin even if the user has Dolphin as the preferred file manager in the "Default Applications" module in System Settings.

This can be tested by opening gwenview and clicking on "Open Containing Folder" in a system with both Nautilus and Dolphin installed.

Also, running qdbus org.freedesktop.FileManager1 shows which application would be run by dbus if the org.freedesktop.FileManager1 service is invoked.

Merge request reports