--- scripts/xdg-open.in.orig	2024-02-06 01:55:07 UTC
+++ scripts/xdg-open.in
@@ -15,6 +15,12 @@
 #
 #---------------------------------------------
 
+# If we are started from a Linux app with LD_PRELOAD set unset that
+# so native apps (like browers) won't fail to start.
+if [ "x$(uname)" = "xLinux" ]; then
+    unset LD_PRELOAD
+fi
+
 manualpage()
 {
 cat << '_MANUALPAGE'
@@ -116,7 +122,7 @@ file_url_to_path()
         if [ -x /usr/bin/printf ]; then
             printf=/usr/bin/printf
         fi
-        file=$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")
+        file=$(echo "$file" | unvis -h)
     fi
     echo "$file"
 }
@@ -220,6 +226,17 @@ open_gnome()
     fi
 }
 
+open_lumina()
+{
+  lumina-open "$1"
+
+  if [ $? -eq 0 ]; then
+       exit_success
+  else
+       exit_failure_operation_failed
+  fi
+}
+
 open_mate()
 {
     if gio help open 2>/dev/null 1>&2; then
@@ -398,7 +415,7 @@ open_generic_xdg_mime()
         [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
 
         xdg_system_dirs="$XDG_DATA_DIRS"
-        [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
+        [ -n "$xdg_system_dirs" ] || xdg_system_dirs=%%LOCALBASE%%/share/:/usr/share/
 
         search_dirs="$xdg_user_dir:$xdg_system_dirs"
         DEBUG 3 "$search_dirs"
@@ -516,7 +533,7 @@ open_generic()
     if [ x"$BROWSER" = x"" ]; then
         BROWSER=www-browser:links2:elinks:links:lynx:w3m
         if has_display; then
-            BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:chromium-browser:google-chrome:$BROWSER
+            BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chrome:chromium-browser:google-chrome:$BROWSER
         fi
     fi
 
@@ -623,6 +640,10 @@ case "$DE" in
 
     gnome)
     open_gnome "$url"
+    ;;
+
+    lumina)
+    open_lumina "$url"
     ;;
 
     mate)
