1 From 835eed6a2b975fba40c3ac18b4cf5429ba9d2836 Mon Sep 17 00:00:00 2001
2 From: Luna Nova <git@lunnova.dev>
3 Date: Wed, 7 Sep 2022 08:45:56 -0700
4 Subject: [PATCH] xdg-open: add $XDG_OPEN_USE_PORTAL env var
6 When set, the same mechanism that is used in a flatpak is used,
7 a dbus call to the portal. This is useful for distros with non-flatpak
8 wrapper or sandboxing features which require the same treatment, eg NixOS.
10 See https://github.com/NixOS/nixpkgs/issues/160923
12 scripts/xdg-open.in | 4 ++++
13 1 file changed, 4 insertions(+)
15 diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
16 index 8de839a..80d8fb3 100644
17 --- a/scripts/xdg-open.in
18 +++ b/scripts/xdg-open.in
19 @@ -508,6 +508,10 @@ if [ x"$DE" = x"" ]; then
23 +if [ -n "$NIXOS_XDG_OPEN_USE_PORTAL" ]; then
27 DEBUG 2 "Selected DE $DE"
29 # sanitize BROWSER (avoid calling ourselves in particular)