bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9779: No usable browser found on Lubuntu


From: Juri Linkov
Subject: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 12:04:10 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (x86_64-pc-linux-gnu)

> Some relevant environment variables when logged in as "Lubuntu":
>
> DESKTOP_SESSION=Lubuntu
> XDG_CURRENT_DESKTOP=LXDE
>
> Some relevant environment variables when logged in as "LXDE":
>
> DESKTOP_SESSION=LXDE
> XDG_CURRENT_DESKTOP=LXDE
>
> The value of "DESKTOP_SESSION" looks like an arbitrary name of the
> current session (the same string as displayed on the Login menu).
>
> It seems that "XDG_CURRENT_DESKTOP" is the most reliable variable
> to determine whether the current desktop is LXDE.

I discovered that /usr/bin/xdg-open contains the following function:

# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase
detectDE()
{
    if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
    elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
    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 [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde;
    else DE=""
    fi
}

But actually checking for "DESKTOP_SESSION" fails when logged in as "Lubuntu".
So we have two options: implement the same checks (using "DESKTOP_SESSION")
or check for "XDG_CURRENT_DESKTOP" that is more reliable than "DESKTOP_SESSION".

Another problem is that when all checks fail in /usr/bin/xdg-open,
it falls back to `open_generic'.  But `browse-url-can-use-xdg-open'
doesn't take into account the case of using `open_generic' in /usr/bin/xdg-open.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]