View previous topic :: View next topic |
Author |
Message |
peter4 Guru
Joined: 19 Jul 2005 Posts: 359 Location: Wroclaw, Poland
|
Posted: Fri Nov 20, 2009 12:57 pm Post subject: how to tell xdg-open to open magnet: links in vuze? |
|
|
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 |
|
|
coolsnowmen Veteran
Joined: 30 Jun 2004 Posts: 1479 Location: No.VA
|
Posted: Mon Dec 07, 2009 4:13 pm Post subject: |
|
|
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 |
|
|
peter4 Guru
Joined: 19 Jul 2005 Posts: 359 Location: Wroclaw, Poland
|
Posted: Mon Dec 07, 2009 10:18 pm Post subject: |
|
|
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 |
|
|
lucapost Veteran
Joined: 24 Nov 2005 Posts: 1419 Location: <ud|me|ts> - Italy
|
Posted: Thu Apr 15, 2010 8:58 am Post subject: |
|
|
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 |
|
|
mrpdaemon Tux's lil' helper
Joined: 23 Aug 2004 Posts: 134
|
Posted: Thu Mar 01, 2012 8:47 am Post subject: |
|
|
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 |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Thu Mar 01, 2012 9:38 am Post subject: |
|
|
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 |
|
|
carlosalvatore n00b
Joined: 22 Nov 2011 Posts: 13
|
Posted: Fri Jun 14, 2013 7:47 am Post subject: If you're using XFCE |
|
|
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 |
|
|
Peach Advocate
Joined: 08 Mar 2003 Posts: 3686 Location: London, UK
|
|
Back to top |
|
|
carlosalvatore n00b
Joined: 22 Nov 2011 Posts: 13
|
Posted: Mon Mar 10, 2014 6:58 pm Post subject: Re: If you're using XFCE |
|
|
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 |
|
|
|