How to Change the Default Torrent Program on Linux (Ubuntu Gnome)
Sometimes you installed a new torrent client such as Deluge, or qBittorrent on your desktop Linux, but you don’t know how to set it as the default. Look no further! The following is everything you need to know about changing the default torrent program on a Linux distro that runs the Gnome desktop enviroment, including ubuntu, Fedora, Arch linux, etc.
Set the Default Program for Opening Torrent Files
To set the default program to open torrent files, open up your file manager, navigate to the directory that contains the downloaded torrent file. Right click the torrent file and select properties in the context menu.
Then select Open With tab, from there you can set the default program to open torrent files.
Set the Default Program to Open Magnet URLs
If you followed the above steps, then when you double click a torrent file in your file manager, your desired torrent client will fire up. But when you click a magnet link in your Firefox or Google Chrome browser, your old torrent client will open up. We will use gio command line utility to alter the default program for magnet links.
First, run the following command to show the default program and alternative programs to open magnet links.
gio mime x-scheme-handler/magnet
As you can see, the default on my system is Transmission.
To set Deluge as the default program for magnet links, run
gio mime x-scheme-handler/magnet deluge.desktop
To set qbittorent as the default program for magnet links, run
gio mime x-scheme-handler/magnet qbittorrent.desktop
Overriding System Default in Firefox
In Firefox browser, you can set the default program to open magnet links. This setting will override the system setting for magnet links.
In Firefox, go to Preferences -> General -> Applications, find the content type of magnet in the list and select the default program.
If you can’t find the magnet content type, then head over to your favourite torrent website in Firefox and click a magnet link on the website. Firefox will ask you to choose a torrent client to open the magnet URL. After you choose a torrent client, you should see the magnet content type in applications panel.
Transfer Unfinished Torrents
Here is a little trick you can use to transfer unfinished torrents from one torrent client to another, or from Linux distro to another distro.
Right click your unfinished torrent and select copy magnet link. Now your magnet link is in the clipboard, you can open it up in another torrent client. For instance, in Transmission, select File > Open URL to open the magnet link.
Set the right download path and transmission will automatically verify downloaded data and continue to download remaining data.
If you have a dual boot setup, you can copy all your magnet links to a file. Then reboot your computer into another operating system. From there you can open your magnet links from your file, set the right download path and continue downloading from where
In Ubuntu 18.04 I used the following:
gio mime application/x-bittorrent qbittorrent.desktop
gio mime x-scheme-handler/magnet qbittorrent.desktop
Thanks Bill
How should I write such a `.desktop` file? Can I use only `.desktop` files? So many questions left :/
Hi, the .desktop file has already been installed by your torrent program in /usr/share/applications/ directory. You don’t need to manually create it.
Unless I am writing the application, and therefore I also need to write the .desktop file 😉 For other users in this case, you can find extensive docs at https://specifications.freedesktop.org/desktop-entry-spec/latest/ or similar pages.
Worked for me but I had to change qbittorrent.desktop to org.qbittorrent.qBittorrent.desktop and reinstall my qbittorrent.
reinstalling and change qbittorrent.desktop to org.qbittorrent.qBittorrent.desktop worked for me
It only work for me in Ubuntu 18.04.4 when I tried to copy the correct command line:
gio mime x-scheme-handler/magnet org.qbittorrent.qBittorrent.desktop
I got the idea when Henrique posted his comment that he had to change the “qbittorrent.desktop” into “org.qbittorrent.qBittorrent.desktop.” Anyway, I must thank Linuxbabe for an interactive post from Linux users who gave their valuable comments.
I am regular reader, how are you everybody? This post posted at this web site is actually
good.