Bug 47172

Summary: xdg-open can't open torrent magnet links in xfce
Product: Portland Reporter: wookiebugs
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: pachoramos1, wookiebugs
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description wookiebugs 2012-03-09 17:40:55 UTC
I'm using Xfce4.8 on arch, with xdg-utils 1.1.0rc1-3, and transmission-gtk

PROBLEM:

xdg-open can't open magnet links in xfce - for example:

$ xdg-open magnet:?xt=urn:btih:fd638f3eafa8a346ff74c0dace96f9bab3834f85&dn=Adventures+of+Huckleberry+Finn+by+Mark+Twain%2C+A+Livrivox+Audio+B&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80
[1] 6124
[2] 6125
[3] 6126
[4] 6127
$ /usr/bin/xdg-open: line 478: firefox: command not found
/usr/bin/xdg-open: line 478: mozilla: command not found
/usr/bin/xdg-open: line 478: epiphany: command not found
/usr/bin/xdg-open: line 478: konqueror: command not found
/usr/bin/xdg-open: line 478: chromium-browser: command not found
/usr/bin/xdg-open: line 478: google-chrome: command not found 304-366
/usr/bin/xdg-open: line 478: links2: command not found

I've read in lots of forums about it trying to open magnets with a list of browsers instead a torrent application, causing problems with, for example, Chromium.

CAUSE:

Running through the function detectDE() in /usr/bin/xdg-open (lines 304 - 366):

line 312 xprop is not installed as standard
line 313 ditto

line 325 the environment variable DESKTOP_SESSION is "Xfce4 Session", so will not match "xfce|xfce4" as given in the case statement, and DE detection will fail.

This means that it's not just magnets - xdg-open misses Xfce completely.

FIX:
line 325 replace "xfce|xfce4)" with "xfce|xfce4|'Xfce Session')"
Comment 1 Rex Dieter 2012-03-09 18:06:15 UTC
So, does fixing the DESKTOP_SESSION matching, fix the issue for you?
Comment 2 wookiebugs 2012-03-10 00:18:53 UTC
Absolutely, Chromium behaves as it should in Xfce with this fix. Although I believe the problem will still exist if there really is no DE - I'll try with Openbox next.
Comment 3 Rex Dieter 2012-03-10 05:56:35 UTC
thanks.

http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=5be359a49d4d8dc3c5f814ab89b8422ad522d837

Fwiw, generic should work these days too, provided that apps that support magnet links include
MimeTypes=...;x-scheme-handler/magnet;
in their .desktop file

And, if you have any pull with those who distribute xfce for you (or xfce upstream), please please tell them to stop modifying the DESKTOP_SESSION value.  This seems to be the 3rd variant we've had to add and support lately. (and it's getting a little rediculous).
Comment 4 wookiebugs 2012-03-10 07:59:18 UTC
Many thanks for that. I tried generic by using the git version in openbox and it works fine too.
For your other point, I'll send a polite link to this bug to Arch, if it's not the distro that's changing DESKTOP_SESSION, it should go upstream.
Comment 5 wookiebugs 2012-03-10 08:51:35 UTC
Sent straight upstream:
https://bugzilla.xfce.org/show_bug.cgi?id=8557
marked trivial as it's a request
Comment 6 Pacho Ramos 2012-03-25 07:22:56 UTC
*** Bug 47833 has been marked as a duplicate of this bug. ***

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.