From e2932f1364dbe128ab326bc220576d02f930e6c1 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 28 Jul 2025 21:22:04 +0000 Subject: [PATCH] xdg-desktop-portal-nautilus: better co-existence with nautilus don't install .desktop files for the portal (else i get two 'Files' app entries); rename to ensure we actually launch the portal instead of normal nautilus. --- .../programs/xdg-desktop-portal-nautilus.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hosts/common/programs/xdg-desktop-portal-nautilus.nix b/hosts/common/programs/xdg-desktop-portal-nautilus.nix index dc4b84a63..191edcaaa 100644 --- a/hosts/common/programs/xdg-desktop-portal-nautilus.nix +++ b/hosts/common/programs/xdg-desktop-portal-nautilus.nix @@ -18,6 +18,14 @@ DBusName=org.gnome.NautilusPortal Interfaces=org.freedesktop.impl.portal.FileChooser EOF + + rm $out/bin/nautilus-autorun-software + rm $out/share/man/man1/nautilus-autorun-software.1 + rm $out/share/applications/*.desktop + rm $out/share/gnome-shell/search-providers/*.ini + + mv $out/bin/{nautilus,nautilus-portal} + mv $out/share/man/man1/{nautilus,nautilus-portal}.1 ''; # define a "profile", which changes the app id/dbus name so that we don't conflict with any other @@ -25,6 +33,12 @@ mesonFlags = (upstream.mesonFlags or []) ++ [ "-Dprofile=Portal" ]; + + meta = (upstream.meta or {}) // { + # in case nautilus & nautilus-portal are both installed and some files conflict (e.g. schemas), + # let the stock nautilus take precedence + priority = ((upstream.meta or {}).priority or 10) + 10; + }; })); sandbox.whitelistDbus.user = true; #< TODO: reduce # to receive requests from xdg-desktop-portal @@ -66,7 +80,7 @@ dependencyOf = [ "xdg-desktop-portal" ]; # NAUTILUS_PERSIST, else --gapplication-service means nautilus exits after 10s of inactivity - command = "env NAUTILUS_PERSIST=1 nautilus --gapplication-service"; + command = "env NAUTILUS_PERSIST=1 nautilus-portal --gapplication-service"; readiness.waitDbus = "org.gnome.NautilusPortal"; }; };