I'm trying to set up qbittorrent to handle magnet: links. I've searched high and low in KDE Settings to no avail. Note that these links don't usually have a distinguishing file extension. Instead they're flagged as magnet:... in the URL.
I use Google Chrome, which is a GTK-oriented browser, so I also tried using gconf-editor to set this up. However the setting is completely ignored (the default is set to use transmission, but in fact clicking on a magnet link always fires up Ktorrent, which I don't want), so that seems to be out.
I've also tried messing with the Chrome text config files, which are undocumented and obscure. The built-in Chrome settings widget is no help either.
In short, I don't know if I'm in the right part of the forest. In fact I'm not sure I'm even in the right forest.
Why is this stuff so hard?
poc
On 03/26/2012 08:11 PM, Patrick O'Callaghan wrote:
I'm trying to set up qbittorrent to handle magnet: links. I've searched high and low in KDE Settings to no avail. Note that these links don't usually have a distinguishing file extension. Instead they're flagged as magnet:... in the URL.
Why is this stuff so hard?
Any app that can support magnet links needs to have x-scheme-handler/magnet listed among supported MimeTypes in their .desktop file, e.g.:
MimeTypes=...;x-scheme-handler/magnet;
that's it. not too hard was it? :)
-- rex
On Tue, 2012-03-27 at 07:23 -0500, Rex Dieter wrote:
On 03/26/2012 08:11 PM, Patrick O'Callaghan wrote:
I'm trying to set up qbittorrent to handle magnet: links. I've searched high and low in KDE Settings to no avail. Note that these links don't usually have a distinguishing file extension. Instead they're flagged as magnet:... in the URL.
Why is this stuff so hard?
Any app that can support magnet links needs to have x-scheme-handler/magnet listed among supported MimeTypes in their .desktop file, e.g.:
MimeTypes=...;x-scheme-handler/magnet;
/usr/share/applications/qBittorrent.desktop already has the line:
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
I copied it to /home/poc/.config/autostart/qBittorrent.desktop (the only .desktop file I have for QBT), restarted QBT and no change, logged out and in, no change. Had a brainwave and looked for magnet in Ktorrent .desktop files. No such line exists in any of them.
Clicking on a magnet link still starts Ktorrent. To be exact, it first starts a pop-up window labelled "Examining", and immediately after I get a Ktorrent error dialogue complaining about not having access to a port (because QBT is sitting on it of course). I don't know if "Examining" is part of Ktorrent or not since it gives no other indication.
that's it. not too hard was it? :)
I'm going to go with 'yes, it is'.
poc
On 03/27/2012 08:02 AM, Patrick O'Callaghan wrote:
On Tue, 2012-03-27 at 07:23 -0500, Rex Dieter wrote:
On 03/26/2012 08:11 PM, Patrick O'Callaghan wrote:
I'm trying to set up qbittorrent to handle magnet: links. I've searched high and low in KDE Settings to no avail. Note that these links don't usually have a distinguishing file extension. Instead they're flagged as magnet:... in the URL.
Why is this stuff so hard?
Any app that can support magnet links needs to have x-scheme-handler/magnet listed among supported MimeTypes in their .desktop file, e.g.:
MimeTypes=...;x-scheme-handler/magnet;
/usr/share/applications/qBittorrent.desktop already has the line:
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
I copied it to /home/poc/.config/autostart/qBittorrent.desktop
Wrong place to put it. Either edit the one in /usr/share/applications, or put your modified one in ~/.local/share/applications
-- rex
On Tue, 2012-03-27 at 09:59 -0500, Rex Dieter wrote:
On 03/27/2012 08:02 AM, Patrick O'Callaghan wrote:
On Tue, 2012-03-27 at 07:23 -0500, Rex Dieter wrote:
On 03/26/2012 08:11 PM, Patrick O'Callaghan wrote:
I'm trying to set up qbittorrent to handle magnet: links. I've searched high and low in KDE Settings to no avail. Note that these links don't usually have a distinguishing file extension. Instead they're flagged as magnet:... in the URL.
Why is this stuff so hard?
Any app that can support magnet links needs to have x-scheme-handler/magnet listed among supported MimeTypes in their .desktop file, e.g.:
MimeTypes=...;x-scheme-handler/magnet;
/usr/share/applications/qBittorrent.desktop already has the line:
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
I copied it to /home/poc/.config/autostart/qBittorrent.desktop
Wrong place to put it. Either edit the one in /usr/share/applications, or put your modified one in ~/.local/share/applications
As I said before, it's already there:
$ grep magnet /usr/share/applications/qBittorrent.desktop MimeType=application/x-bittorrent;x-scheme-handler/magnet;
I had tried putting it in .config/autostart since QBT is an autostarted program, that's all. Just for the heck of it, I also copied it to .local/share/applications as you suggest. It made no difference.
Still counting this as 'hard' (not least because I don't consider any of the above suggestions as remotely obvious to the average user, even if they did actually work).
poc
On 03/28/2012 10:59 AM, Patrick O'Callaghan wrote:
As I said before, it's already there:
$ grep magnet /usr/share/applications/qBittorrent.desktop MimeType=application/x-bittorrent;x-scheme-handler/magnet;
I had tried putting it in .config/autostart since QBT is an autostarted program, that's all. Just for the heck of it, I also copied it to .local/share/applications as you suggest. It made no difference.
Still counting this as 'hard' (not least because I don't consider any of the above suggestions as remotely obvious to the average user, even if they did actually work).
I don't know if this will work.... I've not done it in a long time and not sure it has the desired effect...
How about going to "System Settings", "File Associations" and then going to Application/x-bittorrent and adding qBittorent into the "Application Preference Order" at the top?
On 03/28/2012 12:18 PM, Ed Greshko wrote:
How about going to "System Settings", "File Associations" and then going to Application/x-bittorrent and adding qBittorent into the "Application Preference Order" at the top?
Oh, if I remember correctly...long time ago....I had to logout and login to have the setting take effect.
On Wed, 2012-03-28 at 12:18 +0800, Ed Greshko wrote:
On 03/28/2012 10:59 AM, Patrick O'Callaghan wrote:
As I said before, it's already there:
$ grep magnet /usr/share/applications/qBittorrent.desktop MimeType=application/x-bittorrent;x-scheme-handler/magnet;
I had tried putting it in .config/autostart since QBT is an autostarted program, that's all. Just for the heck of it, I also copied it to .local/share/applications as you suggest. It made no difference.
Still counting this as 'hard' (not least because I don't consider any of the above suggestions as remotely obvious to the average user, even if they did actually work).
I don't know if this will work.... I've not done it in a long time and not sure it has the desired effect...
How about going to "System Settings", "File Associations" and then going to Application/x-bittorrent and adding qBittorent into the "Application Preference Order" at the top?
Because I'm not trying to set a handler for BitTorrent. That part already works. As I noted in my OP, the problem here is that magnet links are not signalled by a special file extension or MIME type, just by a magnet: protocol flag at the start of the URI. Here's an example of one:
magnet:?xt=urn:btih:29b30e19144ee41266e40096ffa09714b6541103&dn= ... etc.
IOW it's analogous to http: or file: or email: but I can't get a clear answer on the mechanics of how this is handled by KDE. Clearly something in my KDE setup thinks that these things should be handled by Ktorrent, but where is this stated and how do I change it? I repeat that no Ktorrent .desktop file on my system even mentions magnet, so what's going on?
poc
On 03/28/2012 08:26 PM, Patrick O'Callaghan wrote:
Because I'm not trying to set a handler for BitTorrent. That part already works. As I noted in my OP, the problem here is that magnet links are not signalled by a special file extension or MIME type, just by a magnet: protocol flag at the start of the URI. Here's an example of one:
magnet:?xt=urn:btih:29b30e19144ee41266e40096ffa09714b6541103&dn= ... etc.
IOW it's analogous to http: or file: or email: but I can't get a clear answer on the mechanics of how this is handled by KDE. Clearly something in my KDE setup thinks that these things should be handled by Ktorrent, but where is this stated and how do I change it? I repeat that no Ktorrent .desktop file on my system even mentions magnet, so what's going on?
OK.... I see what you're after....
Doing a little "test"....
If I use chrome and click on a magnet link it will call ktorrent. If I erase ktorrent it will call transmission. If I erase transmission it will do nothing.
If I use firefox, it will only use transmission....but when it does it brings up a dialog box asking if I want to use it or choose another application. So, one could pick ktorrent or in your case qBittorrent.
Now, the question is...what is the installation of ktorrent or transmission doing that make chrome aware that it can deal with the magnet protocol
On 03/28/2012 11:19 AM, Ed Greshko wrote:
On 03/28/2012 08:26 PM, Patrick O'Callaghan wrote:
Because I'm not trying to set a handler for BitTorrent. That part already works. As I noted in my OP, the problem here is that magnet links are not signalled by a special file extension or MIME type, just by a magnet: protocol flag at the start of the URI. Here's an example of one:
magnet:?xt=urn:btih:29b30e19144ee41266e40096ffa09714b6541103&dn= ... etc.
IOW it's analogous to http: or file: or email: but I can't get a clear answer on the mechanics of how this is handled by KDE. Clearly something in my KDE setup thinks that these things should be handled by Ktorrent, but where is this stated and how do I change it? I repeat that no Ktorrent .desktop file on my system even mentions magnet, so what's going on?
OK.... I see what you're after....
Doing a little "test"....
If I use chrome and click on a magnet link it will call ktorrent. If I erase ktorrent it will call transmission. If I erase transmission it will do nothing.
If I use firefox, it will only use transmission....but when it does it brings up a dialog box asking if I want to use it or choose another application. So, one could pick ktorrent or in your case qBittorrent.
Now, the question is...what is the installation of ktorrent or transmission doing that make chrome aware that it can deal with the magnet protocol
Firefox honours the setting you put in using the gconftool-2 commands this page, but Chromium appears no to.
On 03/28/2012 10:26 PM, Patrick Boutilier wrote:
Firefox honours the setting you put in using the gconftool-2 commands this page, but Chromium appears no to.
It seems chrome does honor those settings *if* you are running in a GNOME environment, but not KDE.
On 03/28/2012 11:54 PM, Ed Greshko wrote:
On 03/28/2012 10:26 PM, Patrick Boutilier wrote:
Firefox honours the setting you put in using the gconftool-2 commands this page, but Chromium appears no to.
It seems chrome does honor those settings *if* you are running in a GNOME environment, but not KDE.
Well.... Will wonders ever cease....
If I enter the appropriate gconftool-2 and then execute chrome this way....
export DE=gnome ; /opt/google/chrome/google-chrome
It will honor the gconftool-2 settings....
On Thu, 2012-03-29 at 00:16 +0800, Ed Greshko wrote:
On 03/28/2012 11:54 PM, Ed Greshko wrote:
On 03/28/2012 10:26 PM, Patrick Boutilier wrote:
Firefox honours the setting you put in using the gconftool-2 commands this page, but Chromium appears no to.
It seems chrome does honor those settings *if* you are running in a GNOME environment, but not KDE.
Well.... Will wonders ever cease....
If I enter the appropriate gconftool-2 and then execute chrome this way....
export DE=gnome ; /opt/google/chrome/google-chrome
It will honor the gconftool-2 settings....
Hardly surprising, since it's a GTK app.
poc
On 03/29/2012 05:36 AM, Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 00:16 +0800, Ed Greshko wrote:
On 03/28/2012 11:54 PM, Ed Greshko wrote:
On 03/28/2012 10:26 PM, Patrick Boutilier wrote:
Firefox honours the setting you put in using the gconftool-2 commands this page, but Chromium appears no to.
It seems chrome does honor those settings *if* you are running in a GNOME environment, but not KDE.
Well.... Will wonders ever cease....
If I enter the appropriate gconftool-2 and then execute chrome this way....
export DE=gnome ; /opt/google/chrome/google-chrome
It will honor the gconftool-2 settings....
Hardly surprising, since it's a GTK app.
OK, so now you can do what you want. Right?
Although a "kludge", the case is close? Or???
On Thu, 2012-03-29 at 06:47 +0800, Ed Greshko wrote:
On 03/29/2012 05:36 AM, Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 00:16 +0800, Ed Greshko wrote:
On 03/28/2012 11:54 PM, Ed Greshko wrote:
On 03/28/2012 10:26 PM, Patrick Boutilier wrote:
Firefox honours the setting you put in using the gconftool-2 commands this page, but Chromium appears no to.
It seems chrome does honor those settings *if* you are running in a GNOME environment, but not KDE.
Well.... Will wonders ever cease....
If I enter the appropriate gconftool-2 and then execute chrome this way....
export DE=gnome ; /opt/google/chrome/google-chrome
It will honor the gconftool-2 settings....
Hardly surprising, since it's a GTK app.
OK, so now you can do what you want. Right?
Yes, it works as long as one does all the preliminaries and always executes Chrome in the above manner.
Although a "kludge", the case is close? Or???
By no means:
1) It *is* a kludge and is clearly brittle e.g. Chrome makes certain choices based on the desktop environment, such as which password store to use. Forcing it to think it's in Gnome when it really isn't means these factors also need to be worked around.
2) The kludge happens to work for Chrome because the latter is a GTK app. It's not a general solution.
3) It took a lot of effort to find, i.e. the "solution" is not easily discoverable, and in fact works by *not* using anything in the KDE environment. My original comment about this being too hard still stands.
poc
On 03/29/2012 12:09 PM, Patrick O'Callaghan wrote:
By no means:
- It *is* a kludge and is clearly brittle e.g. Chrome makes certain
choices based on the desktop environment, such as which password store to use. Forcing it to think it's in Gnome when it really isn't means these factors also need to be worked around.
- The kludge happens to work for Chrome because the latter is a GTK
app. It's not a general solution.
- It took a lot of effort to find, i.e. the "solution" is not easily
discoverable, and in fact works by *not* using anything in the KDE environment. My original comment about this being too hard still stands.
So, you will file a bugzilla with the Chrome folks, right? :-)
With FF, the solution is to edit their settings in about:config, right? It somehow knew about "transmission" but not about "ktorrent" so the "fix" (I believe) would have to go there.
Whose effort found the solution? :-) :-)
On Thu, 2012-03-29 at 12:18 +0800, Ed Greshko wrote:
On 03/29/2012 12:09 PM, Patrick O'Callaghan wrote:
By no means:
- It *is* a kludge and is clearly brittle e.g. Chrome makes certain
choices based on the desktop environment, such as which password store to use. Forcing it to think it's in Gnome when it really isn't means these factors also need to be worked around.
- The kludge happens to work for Chrome because the latter is a GTK
app. It's not a general solution.
- It took a lot of effort to find, i.e. the "solution" is not easily
discoverable, and in fact works by *not* using anything in the KDE environment. My original comment about this being too hard still stands.
So, you will file a bugzilla with the Chrome folks, right? :-)
Once again, this is not a problem with Chrome! The particular kludge happens to work with Chrome, but it's not a general solution to the problem of setting a protocol handler in KDE.
I will consider filing a BZ with KDE though.
With FF, the solution is to edit their settings in about:config, right? It somehow knew about "transmission" but not about "ktorrent" so the "fix" (I believe) would have to go there.
In fact both KDE and Gnome are supposed to use the XDG standard for making these decisions, which in Fedora is expressed through a bunch of Shell scripts (look for /usr/bin/xdg-*). The browsers have their own mechanisms as well, but as we've seen they don't necessarily mesh well with the DE. Maybe the division of responsibilities isn't clear enough, I don't really know.
Whose effort found the solution? :-) :-)
I appreciate your efforts Ed, but I hope you'll understand that IMHO even a working kludge is not the same as a solution.
Cheers
poc
On 03/29/2012 12:28 PM, Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 12:18 +0800, Ed Greshko wrote:
On 03/29/2012 12:09 PM, Patrick O'Callaghan wrote:
By no means:
- It *is* a kludge and is clearly brittle e.g. Chrome makes certain
choices based on the desktop environment, such as which password store to use. Forcing it to think it's in Gnome when it really isn't means these factors also need to be worked around.
- The kludge happens to work for Chrome because the latter is a GTK
app. It's not a general solution.
- It took a lot of effort to find, i.e. the "solution" is not easily
discoverable, and in fact works by *not* using anything in the KDE environment. My original comment about this being too hard still stands.
So, you will file a bugzilla with the Chrome folks, right? :-)
Once again, this is not a problem with Chrome! The particular kludge happens to work with Chrome, but it's not a general solution to the problem of setting a protocol handler in KDE.
I will consider filing a BZ with KDE though.
Why do you think it is not a problem with Chrome? If Chrome doesn't make program selections based on the O/S it is running on then???
What do you want to happen? How will the OS influence what Chrome is calling to complete an action it can't complete on its own?
With FF, the solution is to edit their settings in about:config, right? It somehow knew about "transmission" but not about "ktorrent" so the "fix" (I believe) would have to go there.
In fact both KDE and Gnome are supposed to use the XDG standard for making these decisions, which in Fedora is expressed through a bunch of Shell scripts (look for /usr/bin/xdg-*). The browsers have their own mechanisms as well, but as we've seen they don't necessarily mesh well with the DE. Maybe the division of responsibilities isn't clear enough, I don't really know.
If the browsers mechanisms don't mesh with the DE then "who" is responsible to fixing it?
Whose effort found the solution? :-) :-)
I appreciate your efforts Ed, but I hope you'll understand that IMHO even a working kludge is not the same as a solution.
I did indeed say it was a "kludge" so I'm sure I know the difference. :-)
The point however is...at the moment you've only got a "kludge" as an option....as far as I can tell. :-(
Yes, you're welcome.
On Thu, 2012-03-29 at 12:39 +0800, Ed Greshko wrote:
So, you will file a bugzilla with the Chrome folks, right? :-)
Once again, this is not a problem with Chrome! The particular kludge happens to work with Chrome, but it's not a general solution to the problem of setting a protocol handler in KDE.
I will consider filing a BZ with KDE though.
Why do you think it is not a problem with Chrome? If Chrome doesn't make program selections based on the O/S it is running on then???
Actually there are two alternatives:
1) Chrome is broken and only obeys Gnome settings. 2) Chrome obeys the current DE but we haven't figured out how to change the settings in KDE.
The fact that Chrome pays attention to a $DE environment variable (rather than just assuming it's on Gnome) makes me think the problem is 2 and not 1.
In fact I suspect that Chrome just uses xdg-open. I think the solution to all this may be centered on xdg-settings, the manual for which gives this example:
xdg-settings set default-url-scheme-handler mailto evolution.desktop
However I still haven't figured out the proper incantation for magnet (I may have to set up a qbittorrent.desktop file, which currently doesn't exist).
This is all theory of course.
poc
On 03/29/2012 07:48 AM, Patrick O'Callaghan wrote:
In fact I suspect that Chrome just uses xdg-open. I think the solution to all this may be centered on xdg-settings, the manual for which gives this example:
xdg-settings set default-url-scheme-handler mailto evolution.desktop
However I still haven't figured out the proper incantation for magnet (I may have to set up a qbittorrent.desktop file, which currently doesn't exist).
tried xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop yet?
-- rex
On Thu, 2012-03-29 at 07:58 -0500, Rex Dieter wrote:
On 03/29/2012 07:48 AM, Patrick O'Callaghan wrote:
In fact I suspect that Chrome just uses xdg-open. I think the solution to all this may be centered on xdg-settings, the manual for which gives this example:
xdg-settings set default-url-scheme-handler mailto evolution.desktop
However I still haven't figured out the proper incantation for magnet (I may have to set up a qbittorrent.desktop file, which currently doesn't exist).
tried xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop yet?
Yes, doesn't work. See recent message.
poc
On Thu, 2012-03-29 at 09:11 -0430, Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 21:21 +0800, Ed Greshko wrote:
On 03/29/2012 09:10 PM, Patrick O'Callaghan wrote:
Yes, doesn't work. See recent message.
But, does it work with xdg-open?
I already said it did.
But now it doesn't! This is the sequence of events:
- I ran xdg-settings as mentioned previously - I used "xdg-settings get default-url-scheme-handler magnet" to confirm - I ran xdg-open magnet:... and it started a torrent download in QBT - I clicked on a magnet link on a web page and it tried to run Ktorrent. - I logged out - I logged in - I used "xdg-settings get ..." to confirm that the scheme-handler was still set. - I ran Konqueror to see what would happen, and clicked on a magnet link. - Konqueror tried to run Ktorrent. - I killed Konqueror - I ran "xdg-settings get ..." to make the sure the scheme had not changed. - I ran xdg-open magnet:... and it tried to run Ktorrent! - Logged out and in again - Rechecked the scheme-handler - Tried xdg-open again, and again it tried to run Ktorrent.
Could Konqueror have changed some setting behind the scenes?
poc
On 03/29/2012 09:53 PM, Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 09:11 -0430, Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 21:21 +0800, Ed Greshko wrote:
On 03/29/2012 09:10 PM, Patrick O'Callaghan wrote:
Yes, doesn't work. See recent message.
But, does it work with xdg-open?
I already said it did.
But now it doesn't! This is the sequence of events:
- I ran xdg-settings as mentioned previously
- I used "xdg-settings get default-url-scheme-handler magnet" to confirm
- I ran xdg-open magnet:... and it started a torrent download in QBT
- I clicked on a magnet link on a web page and it tried to run Ktorrent.
- I logged out
- I logged in
- I used "xdg-settings get ..." to confirm that the scheme-handler was
still set.
- I ran Konqueror to see what would happen, and clicked on a magnet
link.
- Konqueror tried to run Ktorrent.
- I killed Konqueror
- I ran "xdg-settings get ..." to make the sure the scheme had not
changed.
- I ran xdg-open magnet:... and it tried to run Ktorrent!
- Logged out and in again
- Rechecked the scheme-handler
- Tried xdg-open again, and again it tried to run Ktorrent.
Could Konqueror have changed some setting behind the scenes?
I don't know..... But, here is something equally bizarre.....
I did the following....
1. yum erase of ktorrent and transmission 2. logout/login 3. xdg-open magnet ---- fails as expected 4. yum install ktorrent 5. logout/login 6. xdg-settings get default-url-scheme-handler magnet returns nothing 7. xdg-open magnet ---- ktorrent is called 8. yum install transmission 9 logout/login 10. xdg-settings get default-url-scheme-handler magnet returns transmission-gtk.desktop 11. xdg-open magnet ---- ktorrent is called
???? why not transmission?
I think I need to know what files are altered by the xdg commands and what are the system-wide v.s. per-user config files.
On Thu, 2012-03-29 at 23:23 +0800, Ed Greshko wrote:
???? why not transmission?
I think I need to know what files are altered by the xdg commands and what are the system-wide v.s. per-user config files.
Because Ktorrent is "special" and gets in the way. Rex's new fix should hopefully correct this.
poc
On Thu, 2012-03-29 at 08:18 -0430, Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 12:39 +0800, Ed Greshko wrote:
So, you will file a bugzilla with the Chrome folks, right? :-)
Once again, this is not a problem with Chrome! The particular kludge happens to work with Chrome, but it's not a general solution to the problem of setting a protocol handler in KDE.
I will consider filing a BZ with KDE though.
Why do you think it is not a problem with Chrome? If Chrome doesn't make program selections based on the O/S it is running on then???
Actually there are two alternatives:
- Chrome is broken and only obeys Gnome settings.
- Chrome obeys the current DE but we haven't figured out how to change
the settings in KDE.
The fact that Chrome pays attention to a $DE environment variable (rather than just assuming it's on Gnome) makes me think the problem is 2 and not 1.
In fact I suspect that Chrome just uses xdg-open. I think the solution to all this may be centered on xdg-settings, the manual for which gives this example:
xdg-settings set default-url-scheme-handler mailto evolution.desktop
However I still haven't figured out the proper incantation for magnet (I may have to set up a qbittorrent.desktop file, which currently doesn't exist).
This is all theory of course.
Back to the drawing board. In fact there is a qBittorrent.desktop file (note the capitalization), and I can set it using xdg-settings. In fact if I run xdg-open everything Just Works.
But clicking on a magnet link in Chrome (without setting the DE) still fires up Ktorrent. Maybe hypothesis 1 is correct and Chrome really is broken. Or maybe I'm just not understanding how all the pieces fit together.
:-(
poc
OK, I consulted ktorrent upstream on this, and it seems it gets the magnet protocol handling via /usr/share/kde4/services/magnet.protocol which is a (imo) deprecated way of doing it (vs. the setting MimeTypes=x-scheme-handler/magnet way).
A secondary issue specific to our current ktorrent builds is that we still build it with kio_magnet support, which upstream currently does not recommend.
So, I'll see if I can sort out the mess, and come up with something that works better.
-- rex
On 03/29/2012 11:24 AM, Rex Dieter wrote:
OK, I consulted ktorrent upstream on this, and it seems it gets the magnet protocol handling via /usr/share/kde4/services/magnet.protocol which is a (imo) deprecated way of doing it (vs. the setting MimeTypes=x-scheme-handler/magnet way).
A secondary issue specific to our current ktorrent builds is that we still build it with kio_magnet support, which upstream currently does not recommend.
So, I'll see if I can sort out the mess, and come up with something that works better.
OK, I think I found a bug in xdg-settings too:
This seems to work: xdg-mime default qBittorrent.desktop x-scheme-handler/magnet
-- rex
On 03/29/2012 11:33 AM, Rex Dieter wrote:
On 03/29/2012 11:24 AM, Rex Dieter wrote:
OK, I consulted ktorrent upstream on this, and it seems it gets the magnet protocol handling via /usr/share/kde4/services/magnet.protocol which is a (imo) deprecated way of doing it (vs. the setting MimeTypes=x-scheme-handler/magnet way).
A secondary issue specific to our current ktorrent builds is that we still build it with kio_magnet support, which upstream currently does not recommend.
So, I'll see if I can sort out the mess, and come up with something that works better.
OK, I think I found a bug in xdg-settings too:
This seems to work: xdg-mime default qBittorrent.desktop x-scheme-handler/magnet
oh, and remove /usr/share/kde4/services/magnet.protocol
-- rex
Rex Dieter wrote:
OK, folded the ktorrent-related changes into ktorrent-4.2.0-3 build now in kde-testing and queue'd for updates-testing repos.
%changelog * Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-3 - omit magnet.protocol - support/use MimeTypes=x-scheme-handler/magnet; instead
* Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-2 - drop ENABLE_KIO_MAGNET, let main app handle it
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
-- rex
On 03/30/2012 03:43 AM, Rex Dieter wrote:
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
That part seems not to be in question.
The question is, what happens when you click on a magnet link in the Chrome Browser while running under KDE?
On 03/29/2012 04:52 PM, Ed Greshko wrote:
On 03/30/2012 03:43 AM, Rex Dieter wrote:
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
That part seems not to be in question.
The question is, what happens when you click on a magnet link in the Chrome Browser while running under KDE?
I thought chrome used xdg-open ?
(though it may use a bundled copy of xdg-utils, which may be old and/or buggy).
-- rex
On Thu, 2012-03-29 at 17:21 -0500, Rex Dieter wrote:
On 03/29/2012 04:52 PM, Ed Greshko wrote:
On 03/30/2012 03:43 AM, Rex Dieter wrote:
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
That part seems not to be in question.
The question is, what happens when you click on a magnet link in the Chrome Browser while running under KDE?
I thought chrome used xdg-open ?
(though it may use a bundled copy of xdg-utils, which may be old and/or buggy).
Update: in the light of Rex's comments on Ktorrent, I decided to see what happens if I just remove it, and lo, everything now works, both xdg-open and clicking from Chrome.
So the ultimate culprit does seem to have been interference from Ktorrent. Here's hoping the new version fixes this, but I can live without it for now.
Thanks to all (but I still think the correct solution was way too hard to discover, even without the bug).
poc
On 03/29/2012 04:52 PM, Ed Greshko wrote:
On 03/30/2012 03:43 AM, Rex Dieter wrote:
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
That part seems not to be in question.
Well, prior to these fixes I made to ktorrent packaging, xdg-open (and xdg-settings get ...) would always choose ktorrent
-- rex
On 03/30/2012 06:23 AM, Rex Dieter wrote:
Well, prior to these fixes I made to ktorrent packaging, xdg-open (and xdg-settings get ...) would always choose ktorrent
OK, right....
Now this brings up a question that I have with regards to the xdg- framework.
You've indicated that MimeTypes=x-scheme-handler/magnet is the preferred settings method. Yes?
Is this related in any way to the "System Settings", "File Associations"? If not, when does that have any bearing when a given application is invoked?
I've not used those settings recently...but when I did I remember mixed results.
On 03/29/2012 09:00 PM, Ed Greshko wrote:
On 03/30/2012 06:23 AM, Rex Dieter wrote:
Well, prior to these fixes I made to ktorrent packaging, xdg-open (and xdg-settings get ...) would always choose ktorrent
OK, right....
Now this brings up a question that I have with regards to the xdg- framework.
You've indicated that MimeTypes=x-scheme-handler/magnet is the preferred settings method. Yes?
yes.
Is this related in any way to the "System Settings", "File Associations"?
Yes, it's just a specialized mimetype. downside is that currently kde's file associations kcm doesn't show the x-scheme-handler/ types (yet).
-- rex
On Fri, 2012-03-30 at 07:03 -0500, Rex Dieter wrote:
On 03/29/2012 09:00 PM, Ed Greshko wrote:
On 03/30/2012 06:23 AM, Rex Dieter wrote:
Well, prior to these fixes I made to ktorrent packaging, xdg-open (and xdg-settings get ...) would always choose ktorrent
OK, right....
Now this brings up a question that I have with regards to the xdg- framework.
You've indicated that MimeTypes=x-scheme-handler/magnet is the preferred settings method. Yes?
yes.
Is this related in any way to the "System Settings", "File Associations"?
Yes, it's just a specialized mimetype. downside is that currently kde's file associations kcm doesn't show the x-scheme-handler/ types (yet).
That actually speaks to what I've been trying to say without realizing it. I had a mental model in which Mimetypes were associated with either file extensions or Content-Type email headers, not with protocol handlers. Having all these work uniformly would go a long way to making the configuration more discoverable.
poc
On Thu, 2012-03-29 at 14:43 -0500, Rex Dieter wrote:
Rex Dieter wrote:
OK, folded the ktorrent-related changes into ktorrent-4.2.0-3 build now in kde-testing and queue'd for updates-testing repos.
%changelog
- Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-3
- omit magnet.protocol
- support/use MimeTypes=x-scheme-handler/magnet; instead
- Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-2
- drop ENABLE_KIO_MAGNET, let main app handle it
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
But not for me. As stated previously, xdg-open did work the first time I tried it, but now it doesn't, even though "xdg-settings get" does return the correct result.
poc
Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 14:43 -0500, Rex Dieter wrote:
Rex Dieter wrote:
OK, folded the ktorrent-related changes into ktorrent-4.2.0-3 build now in kde-testing and queue'd for updates-testing repos.
%changelog
- Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-3
- omit magnet.protocol
- support/use MimeTypes=x-scheme-handler/magnet; instead
- Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-2
- drop ENABLE_KIO_MAGNET, let main app handle it
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
But not for me. As stated previously, xdg-open did work the first time I tried it, but now it doesn't, even though "xdg-settings get" does return the correct result.
You sure you upgraded to ktorrent-4.2.0-3, and re-ran said commands afterward?
rpm -q ktorrent
-- rex
On Thu, 2012-03-29 at 18:29 -0500, Rex Dieter wrote:
Patrick O'Callaghan wrote:
On Thu, 2012-03-29 at 14:43 -0500, Rex Dieter wrote:
Rex Dieter wrote:
OK, folded the ktorrent-related changes into ktorrent-4.2.0-3 build now in kde-testing and queue'd for updates-testing repos.
%changelog
- Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-3
- omit magnet.protocol
- support/use MimeTypes=x-scheme-handler/magnet; instead
- Thu Mar 29 2012 Rex Dieter rdieter@fedoraproject.org 4.2.0-2
- drop ENABLE_KIO_MAGNET, let main app handle it
$ xdg-settings set default-url-scheme-handler magnet qBittorrent.desktop $ xdg-settings get default-url-scheme-handler magnet $ xdg-open magnet:foo
all do the right thing for me.
But not for me. As stated previously, xdg-open did work the first time I tried it, but now it doesn't, even though "xdg-settings get" does return the correct result.
You sure you upgraded to ktorrent-4.2.0-3, and re-ran said commands afterward?
rpm -q ktorrent
No, I just removed Ktorrent, which did work. I don't use the kde-testing repo so it was easier to do it that way.
poc
On Wed, 2012-03-28 at 22:19 +0800, Ed Greshko wrote:
On 03/28/2012 08:26 PM, Patrick O'Callaghan wrote:
Because I'm not trying to set a handler for BitTorrent. That part already works. As I noted in my OP, the problem here is that magnet links are not signalled by a special file extension or MIME type, just by a magnet: protocol flag at the start of the URI. Here's an example of one:
magnet:?xt=urn:btih:29b30e19144ee41266e40096ffa09714b6541103&dn= ... etc.
IOW it's analogous to http: or file: or email: but I can't get a clear answer on the mechanics of how this is handled by KDE. Clearly something in my KDE setup thinks that these things should be handled by Ktorrent, but where is this stated and how do I change it? I repeat that no Ktorrent .desktop file on my system even mentions magnet, so what's going on?
OK.... I see what you're after....
Doing a little "test"....
If I use chrome and click on a magnet link it will call ktorrent. If I erase ktorrent it will call transmission. If I erase transmission it will do nothing.
If I use firefox, it will only use transmission....but when it does it brings up a dialog box asking if I want to use it or choose another application. So, one could pick ktorrent or in your case qBittorrent.
Now, the question is...what is the installation of ktorrent or transmission doing that make chrome aware that it can deal with the magnet protocol
Chrome as such may have nothing to do with it. Try the following:
kioclient openProperties <some magnet URI>
The behaviour is exactly the same as what I've been getting from Chrome, ergo it's probably not a problem of Chrome.
Some further burrowing has revealed the existence of /usr/share/kde4/services/magnet.protocol, which calls kio_magnet to do the work. I can't see where to configure kio_magnet, so I copied the file to ~/.kde/share/services and simply substituted QBT for kio_magnet in the file, logged out, logged in.
And got exactly the same result.
Tried it again but editting the original system file. Got a error bell (so a: it doesn't work that way, and b: it doesn't look at the user's personal settings).
Note that kio_magnet is not an executable, it's a .so file which comes as part of the Ktorrent RPM (as does the magnet.protocol file itself), so it may not even be configurable.
Does anyone still maintain that this is "not hard"?
poc
On 03/28/2012 08:26 PM, Patrick O'Callaghan wrote:
so what's going on?
Maybe try this?
http://crunchbanglinux.org/forums/topic/8545/solved-magnet-links-in-chrome/