Bug 25967 - [xdg-utils 1.0.2.20091216] [xdg-settings] refuses to run without DE
Summary: [xdg-utils 1.0.2.20091216] [xdg-settings] refuses to run without DE
Status: RESOLVED FIXED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Per Olofsson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-09 11:34 UTC by Philipp Überbacher
Modified: 2015-10-06 01:25 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Philipp Überbacher 2010-01-09 11:34:44 UTC
Arch Linux: xdg-utils 1.0.2.20091216-1

xdg-settings get default-browser
xdg-settings: unknown desktop environment

That's all I get, and no way to specify the default browser.
It ignored $BROWSER.
I tested with sage: http://www.sagemath.org/

In the end I had to hack the fallback in xdg-open to include my browser.

IMHO xdg-settings should work properly without DE, since it appears to be the only way to specify defaults for people without DE. DEs include their own tools anyway.
Comment 1 Lei Zhang 2010-01-27 12:08:11 UTC
What desktop environment / window manager are you running?

The question is, if you're not using GNOME/KDE/XFCE, how should xdg-settings get/set the default browser?

Maybe the answer depends on how xdg-open decides to handle http://url. With the upstream version, it tries mime-open, run-mailcap, and $BROWSER. (Debian? / Ubuntu patched their copy to behave differently) This would mean xdg-settings have to know how to interact with mime-open, run-mailcap, and be able to set $BROWSER if needed.

I guess I can take this bug, though it'll be a low priority item. If you really want this fixed, patches are welcome. :)
Comment 2 Philipp Überbacher 2010-01-27 14:32:27 UTC
I'm currently running awesome, which is just a WM.
I'm on Arch Linux, a distro that doesn't patch when not absolutely necessary, so I get upstream code.

In my case xdg-open always used its fallback, which is three hardcoded browser names, and those didn't correspond to any browser installed. My current workaround is to edit /usr/bin/xdg-open and change the fallback to the browser I want to use, but why this is no solution should be obvious.

I'm not familiar with how mime-open or run-mailcap works, but if xdg-open would use $BROWSER it would be a start (it was ignored last I tried, but $BROWSER wasn't set in the login shell, so maybe this was part of the problem).

When I ignore mime-open and run-mailcap there are two possible solutions I can think of, one would be to set $BROWSER and to make sure that xdg-open cares about that, but I guess this would have drawbacks inherent to env variables.
The other idea is to add the possibility to set the xdg-open fallback using xdg-settings, or something similar. This would need a config file somewhere I guess. I actually was looking for such a config for a while until I found out that those browsers are simply 'hardcoded' (from a user pov) in xdg-open.

Thanks for taking care of that.
It happens often enough that the desktop world doesn't even recognize that something besides the DEs and desktops even exists.
Comment 3 Ben Rich 2010-02-16 12:50:56 UTC
I aggree with the original poster that this is not intuitive, nor does it provide a good solution for non-DE users.  I have encountered the same problem while using compiz as a standalone WM.  If I type 'xdg-open --list' I see 'default-web-browser' as a known property, but i can't get/set its value, which is confusing.  Couldn't there be a simple configuration file where default applications could be specified?
Comment 4 John Schmitt 2012-11-04 20:56:12 UTC
I run openbox (on Fedora 17 if that matters) and I can't seem to use xdg-settings unless I specify DE:

$ xdg-settings set default-web-browser chromium-browser.desktop
xdg-settings: unknown desktop environment

It seemed to work when I did this:

$ DE=gnome xdg-settings set default-web-browser chromium-browser.desktop
Comment 5 Alexander Gehrke 2013-10-24 12:31:23 UTC
xdg-open also tries to use a program registered for the mime type x-scheme-handler/http when given an url. So I managed to change the default browser with:

$ xdg-mime default firefox.desktop x-scheme-handler/http

Perhaps xdg-settings could fallback to this setting, when no DE is found. (Probably should also set it for https)
Comment 6 Per Olofsson 2015-10-06 01:25:15 UTC
This bug was fixed in 1.1.0.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.