On my (mostly desktop environment free) laptop I am experimenting with xdg-desktop-portal
, mainly to give sandboxed applications a way to open links.
So I enabled the portals using
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
xdg.portal.config.common.default = [ "gtk" ];
and indeed, they are running, and
NIXOS_XDG_OPEN_USE_PORTAL=1 xdg-open http://localhost
opens a browser – but the wrong one, it opens chrominum, although I prefer firefox.
All the different ways of setting default appilcations that I could find are correctly set up
$ gio mime x-scheme-handler/http
Default application for ?x-scheme-handler/http?: firefox.desktop
Registered applications:
firefox.desktop
google-chrome.desktop
Recommended applications:
firefox.desktop
google-chrome.desktop
$ xdg-mime query default x-scheme-handler/http
firefox.desktop
and both xdg-open http://localhost
and gio open http://test.de
do the “right thing”. So why would xdg-desktop-portal (plausibly in this file) pick chrome instead – any hints?
(Using the gnome
portal backend instead of gtk
does not change things … not unexpected, given that url handling is done by xdg-desktop-portal
itself.)