
{"id":36967,"date":"2022-01-23T18:05:33","date_gmt":"2022-01-23T18:05:33","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=36967"},"modified":"2024-10-03T11:27:19","modified_gmt":"2024-10-03T11:27:19","slug":"default-torrent-app-magnet-links-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/01\/default-torrent-app-magnet-links-ubuntu\/","title":{"rendered":"Change Default Torrent Client for Magnet Links in Ubuntu 24.04 | 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/qbittorrent-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-36697\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/qbittorrent-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/qbittorrent-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/qbittorrent-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/qbittorrent-icon-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/qbittorrent-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/qbittorrent-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p><b>When clicking a magnet link in Chrome browser, it pops-up with &#8220;<i>Open xdg-open<\/i>&#8221; option allows to launch the default app to start the downloading.<\/b><\/p>\n<p>Unlike Firefox, Google Chrome does not offer an option to choose which app to handle the link. Instead, it launches the default app directly. For those want to change this default app to handle magnet links, here&#8217;s how to do the trick in Ubuntu.<\/p>\n<div id=\"attachment_36968\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/chrome-openmagnet.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-36968\" class=\"size-large wp-image-36968\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/chrome-openmagnet-600x395.webp\" alt=\"\" width=\"600\" height=\"395\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/chrome-openmagnet-600x395.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/chrome-openmagnet-300x197.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/chrome-openmagnet-768x505.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/chrome-openmagnet.webp 961w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-36968\" class=\"wp-caption-text\">Click &#8220;Open xdg-open&#8221; to open link via default app<\/p><\/div>\n<h3>Step 1: Tell the default app for magnet links:<\/h3>\n<p>Firstly, press <b>Ctrl+Alt+T<\/b> on keyboard to open a terminal window. When it opens, run the command below will tell the default app for magnet links:<\/p>\n<pre>xdg-mime query default x-scheme-handler\/magnet<\/pre>\n<p>Here <code>xdg-mime<\/code> is the standard wrapper. User may also run this command instead, which will also output the registered applications:<\/p>\n<pre>gio mime x-scheme-handler\/magnet<\/pre>\n<div id=\"attachment_36969\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/list-default-magnet.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-36969\" class=\"size-full wp-image-36969\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/list-default-magnet.png\" alt=\"\" width=\"600\" height=\"278\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/list-default-magnet.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/list-default-magnet-300x139.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-36969\" class=\"wp-caption-text\">Tell the default app for magnet<\/p><\/div>\n<h3>Step 2: Set\/Change the default app for magnet links:<\/h3>\n<p>As the previous steps shows, the both command also support for changing the default app. Say set &#8220;QBittorrent&#8221; as default app for magnet link, use command:<\/p>\n<pre>xdg-mime default org.qbittorrent.qBittorrent.desktop x-scheme-handler\/magnet<\/pre>\n<p>Or use command:<\/p>\n<pre>gio mime x-scheme-handler\/magnet org.qbittorrent.qBittorrent.desktop<\/pre>\n<p>For any other app, replace <code>org.qbittorrent.qBittorrent.desktop<\/code> in the previous commands via the <i>.desktop<\/i> file. You may even set an un-registered app as default, and <code>gio<\/code> command will register it automatically.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/set-default-magnetapp.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-36970\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/set-default-magnetapp-600x393.webp\" alt=\"\" width=\"600\" height=\"393\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/set-default-magnetapp-600x393.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/set-default-magnetapp-300x197.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/set-default-magnetapp-768x503.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/set-default-magnetapp.webp 813w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>In addition,<\/b> in case you don&#8217;t know the filename of the <i>.desktop<\/i> file for your app, try running following commands one by one to find it out:<\/p>\n<ul>\n<li>First, open terminal and run command to install mlocate (or <b>plocate<\/b> for 22.04 &amp; higher):\n<pre>sudo apt install mlocate plocate<\/pre>\n<\/li>\n<li>Then, update the database:\n<pre>sudo updatedb<\/pre>\n<\/li>\n<li>Finally, search the .desktop file for your torrent app:\n<pre>locate \"*ransmission*desktop\"<\/pre>\n<p>In command, replace <code>ransmission<\/code> with the keyboard for yours. Its case sensitive! I skipped the first letter because which one (&#8216;T&#8217; or &#8216;t&#8217;) is in use for the file-name.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/find-transmissiondesktop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44926\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/find-transmissiondesktop-600x263.webp\" alt=\"\" width=\"600\" height=\"263\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/find-transmissiondesktop-600x263.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/find-transmissiondesktop-300x132.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/find-transmissiondesktop-768x337.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/find-transmissiondesktop.webp 804w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>When clicking a magnet link in Chrome browser, it pops-up with &#8220;Open xdg-open&#8221; option allows to launch the default app to start the downloading. Unlike Firefox, Google Chrome does not offer an option to choose which app to handle the link. Instead, it launches the default app directly. For those want to change this default [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":36697,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[327],"class_list":["post-36967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-bittorrent"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/36967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=36967"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/36967\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/36697"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=36967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=36967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=36967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}