FS#39787 - [xdg-utils] xdg-open does not work with openbox if $DE=openbox

Attached to Project: Arch Linux
Opened by O G-R (ogr) - Wednesday, 09 April 2014, 08:37 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 20 April 2014, 17:19 GMT
Task Type Feature Request
Category Upstream Bugs
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

xdg-open failed to work because it looks like it does not handle openbox correctly.
I dig in the code, and here is my observation.

I have a $DE environnement variable set to "openbox"

xdg-open try to look for current desktop Environnement, via detectDE() function.
In this function, xdg-open looks for an existing $XDG_CURRENT_DESKTOP env variable, which is NOT set on my computer. With this $XDG_CURRENT_DESKTOP, it then set locally a $DE variable.
But in my configuration, I'm not affected, so at the end of this detectDE(), i'm still with a $DE=openbox

See detectDE() in the additionnal info part for more clarity.

After this detectDE there is a case where there is the real problem. Because there is no handling for $DE=openbox, I jump directly in the *) which throw me an error.
Again, see the case part in additionnal info for more clarity.



Additional info:

xdg-open 1.1.0 rc1


detectDE()
{
# see https://bugs.freedesktop.org/show_bug.cgi?id=34164
unset GREP_OPTIONS

if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
case "${XDG_CURRENT_DESKTOP}" in
ENLIGHTENMENT)
DE=enlightenment;
;;
GNOME)
DE=gnome;
;;
KDE)
DE=kde;
;;
LXDE)
DE=lxde;
;;
MATE)
DE=mate;
;;
XFCE)
DE=xfce
;;
esac
fi

if [ x"$DE" = x"" ]; then
# classic fallbacks
if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde;
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate;
elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce
elif echo $DESKTOP | grep -q '^Enlightenment'; then DE=enlightenment;
fi
fi

if [ x"$DE" = x"" ]; then
# fallback to checking $DESKTOP_SESSION
case "$DESKTOP_SESSION" in
gnome)
DE=gnome;
;;
LXDE|Lubuntu)
DE=lxde;
;;
MATE)
DE=mate;
;;
xfce|xfce4|'Xfce Session')
DE=xfce;
;;
esac
fi

if [ x"$DE" = x"" ]; then
# fallback to uname output for other platforms
case "$(uname 2>/dev/null)" in
Darwin)
DE=darwin;
;;
esac
fi

if [ x"$DE" = x"gnome" ]; then
# gnome-default-applications-properties is only available in GNOME 2.x
# but not in GNOME 3.x
which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3"
fi
}



# Before the case, $DE=openbox for me

case "$DE" in
kde)
open_kde "$url"
;;

gnome*)
open_gnome "$url"
;;

mate)
open_mate "$url"
;;

xfce)
open_xfce "$url"
;;

lxde)
open_lxde "$url"
;;

enlightenment)
open_enlightenment "$url"
;;

generic)
open_generic "$url"
;;

*)
exit_failure_operation_impossible "no method available for opening '$url'"
;;
esac


Fix :

My fix is so far is to add a

openbox)
open_generic "$url"
;;

in the case
   xdg-open (19.4 KiB)
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Sunday, 20 April 2014, 17:19 GMT
Reason for closing:  Upstream
Additional comments about closing:  Not our task to implement such features. This has to be done upstream or locally.
Comment by Andreas Radke (AndyRTR) - Wednesday, 09 April 2014, 13:41 GMT
Bring this upstream!

Loading...