Showing posts with label ktorrent. Show all posts
Showing posts with label ktorrent. Show all posts

Friday 13 January 2012

Change magnet links association in linux (Ubuntu)

The Pirate Bay soon will stop serving torrents and a while back I wrote about associating manget links with any torrent client, but that tutorial doesn't work anymore with the newest Ubuntu releases. So, now I'm going to show you how to change the file association so that it will work with any version of Ubuntu or many linux distrobutions.

I'm going to write this tip using ktorrent as it is my favorite torrent client, but if you are using a different client it shouldn't be to hard to change the step to suite your needs. Lets start.

First of all we are going to make sure that you torrent client associates magnet links.

We are going to edit the "*.desktop". They should be under:

/usr/share/applications

in my case because is a kde application it would be under:

/usr/share/applications/kde4

There should be the file we need to open and edit but instead of clicking at it. Open gedit and direct it to that location. You should see a bunch of "*.desktop" files. In my case I will open:

/usr/share/applications/kde4/ktorrent.desktop

In the file you look for the MymeType. You should see something like this:

MimeType=application/x-bittorrent;application/x-torrent;

Now, we will add the magnet association to the file by adding "x-scheme-handler/magnet;" at the end of the MymeType like so:

MimeType=application/x-bittorrent;application/x-torrent;x-scheme-handler/magnet;

Save and close the file. Now we are going to make the system to call the magnet handler we just created by changing/adding the file association. You can change it for each user or the system in general.

The file associations for each user are stored in:

sudo gedit ~/.local/share/applications/mimeapps.list

The system-wide file associations are stored in:

sudo gedit /usr/share/applications/defaults.list

Now look for "x-scheme-handler/magnet", it may not be there but just make sure not to enter duplicates. Now add/edit this line for the handler to call the same "*.desktop" file we edited before. Because in my case the "ktorrent.desktop" file was under the kde4 folder I have to add it, but if you file was on the root of the "/usr/share/applications" there is no need to add anything. In my case it would look like so:

x-scheme-handler/magnet=kde4-ktorrent.desktop;

Save and close the file. Now, you should be able to open Magnet links with you favorite torrent client.



Sunday 19 December 2010

Mono theme icon for ktorrent

Yesterday I talk about associating magnet links in Ubuntu and I mention that my favorite torrent downloaded is ktorrent, but one thing that ktorrent is missing is the mono icon for the appindicator in ubuntu.

I'm not a designer of even close but yesterday I spend a few minutes fixing this annoyance of mine for a while. Now, all my icons in the appindicator are looking nice...


To install it, just download the image below and save it as "ktorrent.png". Now open the terminal and enter:
$ sudo mv /usr/share/icons/hicolor/22x22/apps/ktorrent.png ktorrent_backup.png
$ sudo mv ~/Downloads/ktorrent.png /usr/share/icons/hicolor/22x22/apps
Next time you start ktorrent the appindicator icon will be changed.

Associate magnet links to any application on Ubuntu

This is one of those things that I've meaning to do for a while. This will work with any torrent client that supports magnet links. I use ktorrent which for me is the best out there.

Enter this into the terminal:
$ gconftool-2 -t string -s /desktop/gnome/url-handlers/magnet/command "ktorrent %i -caption "%c" %u"
Change what is comas with your preferred torrent client.
$ gconftool-2 -s /desktop/gnome/url-handlers/magnet/needs_terminal false -t bool
$ gconftool-2 -t bool -s /desktop/gnome/url-handlers/magnet/enabled true

If you entered the above correcly you will end up with a new entry in gconf-editor like so:


Remember that mangnet links take a little longer to start downloading, just be patient.