1

I use dolphin as my file manager. I have this behavior of my system: Whenever I open or save something using a KDE app, the dialog used is kdialog. (If you use Plasma you can trigger one using kdialog --getopenfilename .)

kdialog

Some Apps (nearly all or all non KDE apps) are using a different file dialog, I think the one that Gnome has (If you know the name of the package or dialog it would help too).

foreign file dialog

I want all apps, to use kdialog. Is there a way how to set a default or some other solution?

I read this answer, but am not completely sure about this phrase: 'What you'll find is that is the file dialog in is not a spawned process, it's part of the app itself. The way it looks it governed by the libraries the application is written with and the theme applied to that library'. Does this mean - that unless I leave the source code as it is - that I have no chance to trigger a other type of file dialog? The post also suggest this arch wiki about "Uniform look for Qt and GTK applications". I've tried Kvantum, but as I understand it manages themes - file dialogs are not a part of a theme?

Thanks for any clarification.

1 Answer 1

1

I just wanted to do the same thing and after fumbling around based on various posts here and elsewhere, arrived at the following which is working for me using an Arch-based distro and zsh shell:

  • Using the package manager applicable for your distro, make sure you have the following installed:
    • xdg-desktop-portal
    • xdg-desktop-portal-kde
  • In whichever location you want to set an environment variable (I put mine in ~/.zshrc), add: export GTK_USE_PORTAL=1
  • Logout/login then check if it's working

Optionally, before making the environment variable permanent, you could test it out first by running a program from the terminal, prefacing it with the GTK_USE_PORTAL=1, example:> GTK_USE_PORTAL=1 /usr/bin/firefox

5
  • Thanks for your response. I have tried it. Running pacman -Qs xdg-desktop I confirmed bought packages are installed. When running GTK_USER_PORTAL=1 /usr/bin/firefox it uses the same gtk file dialog, when i try it on a kde native app like kolourpaint it keeps using the native kdialog. With the same result I've also tried exporting GTK_USER_PORTAL=1 in the current shell and starting the apps from there.
    – mad_mosel
    Oct 14, 2023 at 10:11
  • @mad_mosel - I just noticed that I fat-fingered the environment variable in the example firefox command, it should be GTK_USE_PORTAL (USE, not USER) - try that and see if it works
    – CaseyR
    Oct 16, 2023 at 16:54
  • Thanks for noticing. I tried it now with GTK_USE_PORTAL= 0 | 1. It failed on = 1, because there is no gtk.portal in /usr/share/xdg-desktop-portal/portals (No such interface “org.freedesktop.portal.FileChooser” on object at path /org/freedesktop/portal/desktop). There is a kde.portal file, so I did KDE_USE_PORTAL= 0 | 1 /usr/bin/firefox. In bought cases =0 and =1 firefox used the same gtk dialog. Also kolourpaint used the same kde native filepicker on =0 and =1.
    – mad_mosel
    Oct 18, 2023 at 12:42
  • @mad_mosel - sorry, I don't know what else to suggest. It would definitely be the GTK_USE_PORTAL=1 from what I've read (you're basically telling GTK-based apps, like firefox, to use this xdg-desktop-portal setup"). I don't believe I logged out or rebooted when I was setting this up but if you haven't already, maybe give that a shot?
    – CaseyR
    Oct 18, 2023 at 19:51
  • It is a good trace - maybe it will help to figure out what to do. I tried to just copy the kde.portal to in gtk.portal, wich doesn't worked. But I will try to put some more effort into this - if I can solve it I will report here. Thanks :)
    – mad_mosel
    Oct 19, 2023 at 19:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .