unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 9779@debbugs.gnu.org
Subject: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 12:04:10 +0300	[thread overview]
Message-ID: <87d3duwtzj.fsf@mail.jurta.org> (raw)
In-Reply-To: <87y5wi3i0s.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 18 Oct 2011 09:55:03 +0300")

> 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.





  parent reply	other threads:[~2011-10-18  9:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 23:14 bug#9779: No usable browser found on Lubuntu Juri Linkov
2011-10-18  1:53 ` Stefan Monnier
2011-10-18  6:55   ` Juri Linkov
2011-10-18  8:12     ` Lawrence Mitchell
2011-10-18  9:09       ` Juri Linkov
2011-10-18  9:53       ` Jan Djärv
2011-10-18  9:04     ` Juri Linkov [this message]
2011-10-18 10:06       ` Jan Djärv
2011-10-18  9:58     ` Jan Djärv
2011-10-19  9:12       ` Juri Linkov
2011-10-19 14:52         ` Jan Djärv
2011-10-19 22:42           ` Juri Linkov
2011-10-18 13:17     ` Stefan Monnier
2011-10-18  5:37 ` Jan Djärv
2011-10-18  6:57   ` Juri Linkov
2011-10-18 13:16     ` Stefan Monnier
2011-10-19  9:10       ` Juri Linkov
2011-10-20 14:47     ` Nix
2011-10-20 18:41       ` Stefan Monnier
2011-10-20 20:08         ` Nix
2011-10-21 11:25           ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d3duwtzj.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=9779@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).