5 ms·
Kind of a niche thing to comment on, but this release lands a commit I made that enables XDG desktop portals support in Firefox. If you're on KDE Plasma, you ca
by moosingin3space 8y ago
Kind of a niche thing to comment on, but this release lands a commit I made that enables XDG desktop portals support in Firefox. If you're on KDE Plasma, you can run Firefox with the environment variable `GTK_USE_PORTAL=1` set and it will use KDE file selection dialogs.
- pmoriarty 8y agoIs there a canonical list of all the environment variables Firefox respects and what they do?
- moosingin3space 8y agoI don't know about that. This particular environment variable is handled by GTK, not Firefox.
- ensignavenger 8y agoThank you, this will be a nice new feature that will be relevant to my setup and appreciated.
- ghostly_s 8y agoVery cool, I don't suppose this will allow one to change the dialog in hybrid/non-DM environments also? I use Openbox with a mix of KDE and GTK apps and this is one of the more common annoyances. I looked into this a while back and couldn't find any info at all.
- moosingin3space 8y agoThis depends on what `xdg-desktop-portal` DBus service is running on your setup. In most non-DE environments, there is no `xdg-desktop-portal`, and as a result, GTK will automatically fall back to GTK file selectors. If you'd like to use KDE file selectors in a non-DE setup, you'll need to get `xdg-desktop-portal-kde` working.
- blattimwind 8y agoThanks!
- zeotroph 8y agoIndeed, and thanks for pointing that out! I am not a fan of the simplified Gtk file dialog, even though I learned the trick of pressing Ctrl-L to edit the location. Let's see if that works with other Gtk apps. Edit: `GTK_USE_PORTAL=1 inkscape/gimp` does not work, seems it requires sandboxing? The xdg-desktop-portal-kde package says "This allows sandboxed applications to request services from outside the sandbox using KDE GUIs".
- moosingin3space 8y agoThe environment variable only works with apps using GtkFileChooserNative, a GTK3-only API that landed in GTK 3.20. (In Firefox, my patch will fall back if you have an older version of GTK3.) GtkFileChooserNative was designed for use by sandboxed Flatpaks, but the environment variable can force it on outside of a sandbox.
- Asooka 8y agoIt might be niche in the grand scheme of things, but for me this is an incredible improvement on my usage of Firefox. This was honestly one of the few things that Chrome did better. Firefox was the only program that I use every day that forced me to use the GTK file selection dialog. Thank you very much!
- alxlaz 8y agoThis isn't a niche thing at all! Assuming you can get xdg-desktop-portal-kde working independently (and I expect it's possible), it's useful everywhere, not just on Plasma. The default "Open File" dialog in GTK 3 is atrocious.
- bscphil 8y agoThank you so much, this is excellent!
- owaislone 8y agoThank you! This is very cool. Would the logical next step be the auto enable this sort of thing based on the platform?
- moosingin3space 8y agoRight now, this is automatically enabled based on whether the application runs in a Flatpak sandbox. I spoke with GTK developers on IRC, and while they want to enable it by default, there are some unresolved issues, summarized in this Reddit comment: https://www.reddit.com/r/firefox/comments/9my9fe/qt_file_picker_in_linux/e7jbc05/ https://www.reddit.com/r/firefox/comments/9my9fe/qt_file_pic....
- nanna 8y agoWould someone mind explaining how to set this for a user (ahem, myself), who've not set environment variables in firefox? A Kubuntu user.
- deleted 8y ago[deleted]
- tlamponi 8y agoThe environment variable here does not refers to a Firefox variable but rather to the OS environment. To test it once you could execute: GTK_USE_PORTAL=1 firefox If you want a more persistent solution you could add export GTK_USE_PORTAL=1 to your .profile or /etc/profile (if you want it for all system users)
- reirob 8y agoI am sorry to be the one to ask, as it seems all the other commenters know it already. I even searched internet for "What are XDG desktip portals", but this came up with results for project that seem to use these portals, but no fast explanation of what they are? Can please somebody summarize what this is about? Disclaimer: I am a Linux user since >20 years, using XMonad window manager on Ubuntu 16.04 at the moment.