Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to tell xdg-open to open magnet: links in vuze?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
peter4
Guru
Guru


Joined: 19 Jul 2005
Posts: 336
Location: Wroclaw, Poland

PostPosted: Fri Nov 20, 2009 12:57 pm    Post subject: how to tell xdg-open to open magnet: links in vuze? Reply with quote

When I click a "something:" link in chrome, like a magnet: link for bittorrent, it says it will use xdg-open, but nothing happens, even though I have vuze installed, which supports magnet: links. How to tell xgd to use a speciffic app with a protocol, or how to tell chrome to launch some other app than xdg-open when klicking on such a link?

btw, xdg-open "magnet:<some data>" in the console produces a single line of output:
Code:
<unknown program name>(14884)/ ClientApp::doIt: Creating ClientApp
(and nothing happens)
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Mon Dec 07, 2009 4:13 pm    Post subject: Reply with quote

I believe the answers lie in this file: /usr/share/mime/packages/freedesktop.org.xml
test using this program: xdg-mime
I also read you need an icon to reference or something don't work.
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
peter4
Guru
Guru


Joined: 19 Jul 2005
Posts: 336
Location: Wroclaw, Poland

PostPosted: Mon Dec 07, 2009 10:18 pm    Post subject: Reply with quote

As far as I can see it's about file types, where I am looking for protocols handling. Correct me if I'm wrong, some advice on how to set it up would be nice too. Thanks anyway.
Back to top
View user's profile Send private message
lucapost
Veteran
Veteran


Joined: 24 Nov 2005
Posts: 1412
Location: <ud|me|ts> - Italy

PostPosted: Thu Apr 15, 2010 8:58 am    Post subject: Reply with quote

I have the same problem with chromium and transmission-remote, to add torrent to my remote transmission-daemon.
Can anybody explain me how to configure xdg? I have only xmonad, not DE
_________________
LP
Back to top
View user's profile Send private message
mrpdaemon
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2004
Posts: 129

PostPosted: Thu Mar 01, 2012 8:47 am    Post subject: Reply with quote

Here is what worked for me:

As root edit /usr/share/applications/vuze.desktop and replace the following lines:

Code:
Exec=vuze
MimeType=application/x-bittorrent;


with these

Code:
Exec=vuze %u
MimeType=application/x-bittorrent;x-scheme-handler/magnet;


Once that is done you need to run update-desktop-database and Chromium should open magnet links in Vuze.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2859
Location: Omnipresent

PostPosted: Thu Mar 01, 2012 9:38 am    Post subject: Reply with quote

FYI, you can check if a certain mimetype is handled using xdg-mime. For example,

Code:
$ xdg-mime query default x-scheme-handler/magnet


If this comes up empty, the desktop file has to be edited as mrpdaemon describes (or, more appropriately, fixed upstream).

If you have multiple handlers, and you want to explicitly set to default, you can do something like:

Code:
$ xdg-mime  default vuze.desktop x-scheme-handler/magnet

_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
carlosalvatore
n00b
n00b


Joined: 22 Nov 2011
Posts: 4

PostPosted: Fri Jun 14, 2013 7:47 am    Post subject: If you're using XFCE Reply with quote

if you use xfce and don't want to mess anything, you could use my solution. I fixed by manually editing xdg-open as follows:

First of all make sure you have the mime associated (as explained before, with xdg-mime)

Then backup xdg-open as root (sudo if that applies)

Code:
# cp /usr/bin/xdg-open cp /usr/bin/xdg-open.old


Finally, edit as root /usr/bin/xdg-open, find open_xfce() and add the lines marked with +, e.g., with nano

Code:
# nano /usr/bin/xdg-open


Code:
open_xfce()
+ if [ "\`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'\`" == "magnet" ]; then
+     gnome-open "$1"
+ else
      exo-open "$1"
+ fi


it only adds the exception for the magnet links, so they will be opened with gnome-open instead of exo-open.

Hope it helps.
_________________
Cowabunga!
Back to top
View user's profile Send private message
Peach
Advocate
Advocate


Joined: 08 Mar 2003
Posts: 3674
Location: London, UK

PostPosted: Sun Jun 23, 2013 10:56 am    Post subject: Reply with quote

solution seems to be on its way: http://git.xfce.org/xfce/exo/commit/?id=05848bb3cb10ea19ef8cba607bdabcd25560063c
_________________
Gentoo user since 2004.
"It's all fun and games, until someone loses an eye" - mom
Back to top
View user's profile Send private message
carlosalvatore
n00b
n00b


Joined: 22 Nov 2011
Posts: 4

PostPosted: Mon Mar 10, 2014 6:58 pm    Post subject: Re: If you're using XFCE Reply with quote

Regarding my last post

carlosalvatore wrote:
if you use xfce and don't want to mess anything, you could use my solution. I fixed by manually editing xdg-open as follows:

First of all make sure you have the mime associated (as explained before, with xdg-mime)

Then backup xdg-open as root (sudo if that applies)

Code:
# cp /usr/bin/xdg-open cp /usr/bin/xdg-open.old


Finally, edit as root /usr/bin/xdg-open, find open_xfce() and add the lines marked with +, e.g., with nano

Code:
# nano /usr/bin/xdg-open


Code:
open_xfce()
+ if [ "\`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'\`" == "magnet" ]; then
+     gnome-open "$1"
+ else
      exo-open "$1"
+ fi


it only adds the exception for the magnet links, so they will be opened with gnome-open instead of exo-open.

Hope it helps.


To make it work properly:

In "/usr/bin/xdg-open"
Code:
open_xfce()
    exo-open "$1"

must be replaced by
Code:
open_xfce()
   VAR_1=`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`;
   if [ "$VAR_1" == "magnet" ]; then
      gnome-open "$1"
   else
      exo-open "$1"
   fi

_________________
Cowabunga!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum