{"id":36927,"date":"2022-01-22T12:27:10","date_gmt":"2022-01-22T12:27:10","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=36927"},"modified":"2024-10-14T08:55:37","modified_gmt":"2024-10-14T08:55:37","slug":"open-copied-magnet-link-kubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/01\/open-copied-magnet-link-kubuntu\/","title":{"rendered":"Single click to Open Magnet Link from Clipboard via KTorrent \/ qBittorrent in KUbuntu"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/kde-logo.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/kde-logo-250x250.png\" alt=\"\" width=\"250\" height=\"250\" class=\"alignleft size-thumbnail wp-image-36930\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/kde-logo-250x250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/kde-logo-300x300.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/kde-logo-600x600.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/kde-logo-768x768.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/kde-logo.png 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Most torrent clients today have ability to detect clipboard for magnet links. However, after copied an URL link, user has to manually open the downloading app and then click &#8216;Open URL&#8217; (or &#8216;Add Torrent Link&#8217;) option to let it paste the link automatically.<\/p>\n<p>Instead of using web browser pop-up to choose app to open an URL, KDE desktop has a built-in feature &#8216;<i>Klipper Actions<\/i>&#8216; that detects clipboard contents and automatically pops-up a menu allows to open link with desired app.<\/p>\n<div id=\"attachment_36931\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/klipper-actions.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-36931\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/klipper-actions.png\" alt=\"\" width=\"600\" height=\"219\" class=\"size-full wp-image-36931\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/klipper-actions.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/klipper-actions-300x110.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-36931\" class=\"wp-caption-text\">Picture 1: Click the pop-up option will automatically launch the app and open the link from clipboard<\/p><\/div>\n<p><b>So just copy a magnet link. It opens the previous context menu (<i>see the picture above<\/i>) automatically, allows to click the menu option to launch your desired app and open the URL.<\/b><\/p>\n<h3>Setup the Klipper Actions for Magnet link in KDE:<\/h3>\n<p>1.) Firstly, find out the &#8216;Clipboard&#8217; indicator in system tray on panel (or click the &#8216;<i>triangle<\/i>&#8216; icon). Then right-click on the icon and choose &#8216;<i>Configure Clipboard<\/i>&#8216;.<\/p>\n<div id=\"attachment_36932\" style=\"width: 609px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/open-klipper-settings.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-36932\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/open-klipper-settings.png\" alt=\"\" width=\"599\" height=\"369\" class=\"size-full wp-image-36932\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/open-klipper-settings.png 599w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/open-klipper-settings-300x185.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/a><p id=\"caption-attachment-36932\" class=\"wp-caption-text\">Open Klipper settings<\/p><\/div>\n<p>2.) When the settings dialog opens, go to &#8216;<i>Actions<\/i>&#8216; in left pane and click on &#8216;<i>Add Actions<\/i>&#8216; button.<\/p>\n<div id=\"attachment_36933\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/configure-clipboardactions.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-36933\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/configure-clipboardactions.png\" alt=\"\" width=\"600\" height=\"554\" class=\"size-full wp-image-36933\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/configure-clipboardactions.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/configure-clipboardactions-300x277.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-36933\" class=\"wp-caption-text\">Add a Klipper action<\/p><\/div>\n<p>3.) In next dialog, do:<\/p>\n<ul>\n<li>input regular expression <b>^magnet:.*<\/b>. It means any content started with &#8216;<i>magnet:<\/i>&#8216; (without quotes). See more about <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/standard\/base-types\/regular-expression-language-quick-reference\" rel=\"noopener\" target=\"_blank\">regular extension<\/a>.<\/li>\n<li>Add description (optional).<\/li>\n<li>Click &#8216;Add Command&#8217; and use <code>qbittorrent %s<\/code> or <code>ktorrent %s<\/code>. Use any torrent client as you prefer. <\/li>\n<li>Type description for command (will display as text in pop-up menu).<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-magnet.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-magnet.png\" alt=\"\" width=\"459\" height=\"525\" class=\"aligncenter size-full wp-image-36934\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-magnet.png 459w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-magnet-262x300.png 262w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/a><\/p>\n<p>4.) After adding an action, the settings dialog will look like the screenshot below. Here I added two actions to handle <i>magnet link<\/i> and <i>url ends with torrent<\/i> with qBittorrent client.<\/p>\n<div id=\"attachment_36935\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-after.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-36935\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-after.png\" alt=\"\" width=\"600\" height=\"545\" class=\"size-full wp-image-36935\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-after.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/01\/clipboardaction-after-300x273.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-36935\" class=\"wp-caption-text\">Actions for magnet links and url ends with .torrent<\/p><\/div>\n<p>After clicking Apply (OK), copy a magnet link and the menu should pop-up automatically, allows to single click launching qBittorrent and open the download.<\/p>\n<p>And, there are keyboard shortcuts: <b>Ctrl+Alt+X<\/b> to enable\/disable Klipper actions, and <b>Ctrl+Alt+R<\/b> to trigger the menu (<i>Picture 1<\/i>) manually.<\/p>","protected":false},"excerpt":{"rendered":"<p>Most torrent clients today have ability to detect clipboard for magnet links. However, after copied an URL link, user has to manually open the downloading app and then click &#8216;Open URL&#8217; (or &#8216;Add Torrent Link&#8217;) option to let it paste the link automatically. Instead of using web browser pop-up to choose app to open an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":36930,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[327],"class_list":["post-36927","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-bittorrent"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/36927","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=36927"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/36927\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/36930"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=36927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=36927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=36927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}