The patch for this probably needs to either also patch xdg-open to not have a fallback case or use the code that xdg-open uses to detect Gnome/KDE/XFCE.
Then do something like
if test -n "$DISPLAY"; then
if test -n "$GNOME_DESKTOP_SESSION_ID"; then
xdg-open "$URL"
elif test -n KDEtest; then
xdg-open "$URL"
elif test -n XFCEtest; then
xdg-open "$URL"
endif
if test -x /usr/bin/x-www-browser; then
exec /usr/bin/x-www-browser "$URL"
elif test -x /usr/bin/x-terminal-emulator && test -x /usr/bin/www-browser; then
exec /usr/bin/x-terminal-emulator -e /usr/bin/www-browser "$URL"
fi
elif test -x /usr/bin/www-browser; then
exec /usr/bin/www-browser "$URL"
fi
The patch for this probably needs to either also patch xdg-open to not have a fallback case or use the code that xdg-open uses to detect Gnome/KDE/XFCE.
Then do something like
if test -n "$DISPLAY"; then DESKTOP_ SESSION_ ID"; then x-www-browser; then x-www-browser "$URL" x-terminal- emulator && test -x /usr/bin/ www-browser; then x-terminal- emulator -e /usr/bin/ www-browser "$URL" www-browser; then www-browser "$URL"
if test -n "$GNOME_
xdg-open "$URL"
elif test -n KDEtest; then
xdg-open "$URL"
elif test -n XFCEtest; then
xdg-open "$URL"
endif
if test -x /usr/bin/
exec /usr/bin/
elif test -x /usr/bin/
exec /usr/bin/
fi
elif test -x /usr/bin/
exec /usr/bin/
fi