How do I assign magnet links to use qbittorrent?

The key /desktop/gnome/url-handlers/magnet in gconf-editor is missing.

How do I assign magnet links to use qbittorrent?

It would be really nice if it were easy to set url handlers. I always struggle with this when doing a fresh install. I would like to set subl:// to open sublime text 2 too.

EDIT: I would like it to work regardless of the application I'm using to activate the link. I'm using Chrome, but IMO the OS (Ubuntu) should be handling links that an application doesn't know how to handle - which it does, so how would one configure this?

EDIT2: This post details how to make the text editor in VIM handle vim:// urls, perhaps this can be applied to to magnet links. i.e create a desktop shortcut defining a MimeType handler then refreshing the cache. (Can't try right now as I'm using 12.04). http://www.tkalin.com/blog_posts/using-console-vim-as-vim-protocol-handler-in-ubuntu


Solution 1:

I had the same problem and managed to fix it by setting the defaults for both gvfs as well as xdg.

check defaults with:

xdg-mime query default x-scheme-handler/magnet
gvfs-mime --query x-scheme-handler/magnet

and set them with

xdg-mime default qbittorent.desktop x-scheme-handler/magnet
gvfs-mime --set x-scheme-handler/magnet qbittorrent.desktop

Assuming you have a qbittorrent.desktop file at /usr/share/applications/

Solution 2:

Probably not the best way, but I achieved this simply by uninstalling Transmission - which caused the default to switch to qBittorrent automatically.

To remove Transmission:

sudo apt purge transmission\*